Skip to content

Commit

Permalink
Merge pull request #22 from equinor/feat/changeStorageKeyToStorageAcc…
Browse files Browse the repository at this point in the history
…ountConString

Rename STORAGE_KEY to STORAGE_ACCOUNT_CON_STRING
  • Loading branch information
matsgoran authored Feb 28, 2023
2 parents 4f44b15 + a16085c commit 2fa475c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env-template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GITHUB_TOKEN=
# Uses the default azurite storage account
# For more information, see https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#authorize-with-shared-key-credentials
STORAGE_KEY="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;"
STORAGE_ACCOUNT_CON_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;"
WEEKLY_RETENTION=1
GITHUB_ORG=equinor
BLOB_CONTAINER=github-archives
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ms-continuus is configured entirely with environment variables.
|MONTHLY_RETENTION:|230|Delete blobs with retentionClass='monthly' older than n-days|
|YEARLY_RETENTION:|420|Delete blobs with retentionClass='yearly' older than n-days|
|GITHUB_TOKEN:|null|Required: Github Personal Access Token|
|STORAGE_KEY:|null|Required: Azure StorageAccount ConnectionString|
|STORAGE_ACCOUNT_CON_STRING:|null|Required: Azure StorageAccount ConnectionString|

## (TODO: Waiting for Blob Idex Tags Preview Feature)

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
ms-continuus:
environment:
GITHUB_URL: http://mock-api:5000
STORAGE_KEY: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://storage-emulator:10000/devstoreaccount1;
STORAGE_ACCOUNT_CON_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://storage-emulator:10000/devstoreaccount1;
depends_on:
- storage-emulator

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
BLOB_CONTAINER: github-archives
WEEKLY_RETENTION: 60
GITHUB_TOKEN: ${GITHUB_TOKEN}
STORAGE_KEY: ${STORAGE_KEY}
STORAGE_ACCOUNT_CON_STRING: ${STORAGE_ACCOUNT_CON_STRING}
2 changes: 1 addition & 1 deletion mock_api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python
FROM python:3.10
WORKDIR /app
ADD . /app
RUN pip install poetry
Expand Down
2 changes: 1 addition & 1 deletion src/BlobStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ms_continuus
public class BlobStorage
{
private static readonly Config Config = new();
private static readonly BlobServiceClient BlobServiceClient = new(Config.StorageKey);
private static readonly BlobServiceClient BlobServiceClient = new(Config.StorageAccountConnectionString);
private BlobContainerClient _containerClient;

public async Task EnsureContainer()
Expand Down
6 changes: 3 additions & 3 deletions src/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public Config()
Console.WriteLine(
"WARNING: Environment variable 'GITHUB_TOKEN' not set. Will continue operating on public repositories only");

StorageKey = Environment.GetEnvironmentVariable("STORAGE_KEY");
if (StorageKey == null) throw new Exception("Environment variable 'STORAGE_KEY' missing");
StorageAccountConnectionString = Environment.GetEnvironmentVariable("STORAGE_ACCOUNT_CON_STRING");
if (StorageAccountConnectionString == null) throw new Exception("Environment variable 'STORAGE_ACCOUNT_CON_STRING' missing");
}

public string Organization { get; }
Expand All @@ -54,7 +54,7 @@ public Config()
public int MonthlyRetention { get; }
public int YearlyRetention { get; }
public string GithubToken { get; }
public string StorageKey { get; }
public string StorageAccountConnectionString { get; }

public override string ToString()
{
Expand Down

0 comments on commit 2fa475c

Please sign in to comment.