-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from sebagomez/fix/slashed-files
Fixes issue with non-prod like Azurite urls
- Loading branch information
Showing
24 changed files
with
178 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
CONTAINER_NAME="azurite" | ||
IMAGE_NAME="mcr.microsoft.com/azure-storage/azurite" | ||
|
||
Check if the container is already running | ||
if [ "$(docker ps -q -f name=${CONTAINER_NAME})" ]; then | ||
echo "Container ${CONTAINER_NAME} is already running." | ||
else | ||
# Check if the container exists but is stopped | ||
if [ "$(docker ps -aq -f status=exited -f name=${CONTAINER_NAME})" ]; then | ||
echo "Starting existing container ${CONTAINER_NAME}." | ||
docker start ${CONTAINER_NAME} | ||
else | ||
echo "Running a new container named ${CONTAINER_NAME}." | ||
docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 --name ${CONTAINER_NAME} ${IMAGE_NAME} | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
cd "${0%/*}" || exit 1 | ||
#!/bin/bash | ||
|
||
dotnet build ./src/web/web.csproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
cd "${0%/*}" || exit 1 | ||
#!/bin/bash | ||
|
||
docker build --tag azurestorageexplorer:local ./src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cd "${0%/*}" || exit 1 | ||
#!/bin/bash | ||
|
||
echo App will run on http://localhost:8080 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
default: | ||
@just --list | ||
|
||
# Build the solution | ||
build: | ||
dotnet build ./src/web/web.csproj | ||
|
||
# Publish and launches in localhost:5000 | ||
publish: | ||
#!/bin/bash | ||
dotnet publish --configuration Release -o ./bin ./src/web/web.csproj | ||
|
||
OK=$? | ||
if [ $OK -eq 0 ]; then | ||
echo Azure Storage Explorer will be running in http://localhost:5000/ | ||
cd bin | ||
dotnet web.dll | ||
cd .. | ||
fi | ||
|
||
# Run unit tests | ||
test: | ||
dotnet test ./tests/StorageLibTests/StorageLibTests.csproj | ||
|
||
# Build Docker image as azurestorageexplorer:local | ||
db: | ||
docker build --tag azurestorageexplorer:local ./src | ||
|
||
# Launches the local docker image at http://localhost:8080 | ||
dr: | ||
echo App will run on http://localhost:8080 | ||
docker run --rm -p 8080:8080 --name azurestorageexplorer azurestorageexplorer:local | ||
|
||
compose: | ||
docker-compose -f ./docker-compose/azurestorageexplorer.yaml up | ||
|
||
uncompose: | ||
docker-compose -f ./docker-compose/azurestorageexplorer.yaml down | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cd "${0%/*}" || exit 1 | ||
#!/bin/bash | ||
|
||
dotnet publish --configuration Release -o ./bin ./src/web/web.csproj | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
|
||
using StorageLibrary.Common; | ||
using StorageLibrary.Interfaces; | ||
using StorageLibrary.Mocks; | ||
|
||
namespace StorageLibrary | ||
{ | ||
public class StorageFactory | ||
{ | ||
static StorageFactory Instance; | ||
|
||
public IQueue Queues { get; private set; } | ||
public IContainer Containers { get; set; } | ||
public ITable Tables { get; set; } | ||
public IFile Files { get; set; } | ||
|
||
StorageFactoryConfig m_currentConfig; | ||
|
||
public StorageFactory() | ||
: this(string.Empty, string.Empty, string.Empty, string.Empty, true) | ||
: this(new StorageFactoryConfig { Mock = true }) | ||
{ } | ||
|
||
public StorageFactory(string account, string key, string endpoint, string connectionString, bool mock = false) | ||
public StorageFactory(StorageFactoryConfig config) | ||
{ | ||
Queues = mock ? new MockQueue() : new AzureQueue(account, key, endpoint, connectionString); | ||
Containers = mock ? new MockContainer() : new AzureContainer(account, key, endpoint, connectionString); | ||
Tables = mock ? new MockTable() : new AzureTable(account, key, endpoint, connectionString); | ||
Files = mock ? new MockFile() : new AzureFile(account, key, endpoint, connectionString); | ||
m_currentConfig = config; | ||
Queues = config.Mock ? new MockQueue() : new AzureQueue(config); | ||
Containers = config.Mock ? new MockContainer() : new AzureContainer(config); | ||
Tables = config.Mock ? new MockTable() : new AzureTable(config); | ||
Files = config.Mock ? new MockFile() : new AzureFile(config); | ||
|
||
Instance = this; | ||
} | ||
|
||
public static BlobItemWrapper GetBlobItemWrapper(string url, long size = 0) | ||
{ | ||
return new BlobItemWrapper(url, size, Instance.m_currentConfig.IsAzurite); | ||
} | ||
} | ||
|
||
public class StorageFactoryConfig | ||
{ | ||
public string Account { get; set; } | ||
public string Key { get; set; } | ||
public string Endpoint { get; set; } = "core.windows.net"; | ||
public string ConnectionString { get; set; } | ||
public bool IsAzurite { get; set; } | ||
public bool Mock { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<AzureStorageWebExplorerVersion>2.17.0</AzureStorageWebExplorerVersion> | ||
<AzureStorageWebExplorerVersion>2.17.1</AzureStorageWebExplorerVersion> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.