generated from hmcts/service-hmcts-crime-springboot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Azurite existingvar #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Azurite existingvar #137
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e8d26ce
chore: revert add of Build-Docker step because it needs $CERTS_DIR wh…
coling01 84b754e
Merge remote-tracking branch 'origin/main'
coling01 dd1ab97
added environmnet variable for azurite secret
d6d150a
removed mandatory
88260d2
Merge remote-tracking branch 'origin/main'
coling01 5cf50c1
removed secret
8e9bc98
chore: throw error if AZURE_STORAGE_CONNECTION_STRING is not set for …
coling01 efac292
chore: expose vars.AZURE_STORAGE_CONNECTION_STRING to environment for…
coling01 1e02c2f
chore: expose vars.AZURE_STORAGE_CONNECTION_STRING to environment for…
coling01 b417674
chore: expose vars.AZURE_STORAGE_CONNECTION_STRING to environment for…
coling01 da3d151
chore: expose vars.AZURE_STORAGE_CONNECTION_STRING to environment for…
coling01 51f6d43
chore: fix 2 pmd errors blocking pipeline
coling01 7ce0ad7
Merge branch 'main' into azurite_existingvar
coling01 0dc7329
chore: fix buyild pipeline to expose AZURE_STORAGE_CONNECTION_STRING …
coling01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
50 changes: 50 additions & 0 deletions
50
src/integrationTest/resources/wiremock-seed/azurite-seed.sh
This file contains hidden or 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,50 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| if [ -z "${AZURE_STORAGE_CONNECTION_STRING}" ]; then | ||
| echo "Error - AZURE_STORAGE_CONNECTION_STRING must be set" | ||
| exit 1 | ||
| fi | ||
| CS="${AZURE_STORAGE_CONNECTION_STRING}" | ||
|
|
||
| echo "Waiting for Azurite..." | ||
| i=0 | ||
| until az storage container list --connection-string "$CS" >/dev/null 2>&1; do | ||
| i=$((i+1)) | ||
| [ "$i" -lt 60 ] || { echo "Azurite not ready"; exit 1; } | ||
| sleep 1 | ||
| done | ||
|
|
||
| echo "Creating documents container..." | ||
| az storage container create \ | ||
| --name documents \ | ||
| --public-access blob \ | ||
| --connection-string "$CS" >/dev/null | ||
|
|
||
| echo "Enforcing public access..." | ||
| az storage container set-permission \ | ||
| --name documents \ | ||
| --public-access blob \ | ||
| --connection-string "$CS" >/dev/null | ||
|
|
||
| echo "Uploading source.pdf..." | ||
| [ -f /seed/source.pdf ] || { echo "Missing /seed/source.pdf"; ls -la /seed; exit 1; } | ||
|
|
||
| az storage blob upload \ | ||
| --overwrite true \ | ||
| --container-name documents \ | ||
| --name source.pdf \ | ||
| --file /seed/source.pdf \ | ||
| --content-type application/pdf \ | ||
| --connection-string "$CS" >/dev/null | ||
|
|
||
| echo "Verifying source blob exists..." | ||
| az storage blob show \ | ||
| --container-name documents \ | ||
| --name source.pdf \ | ||
| --connection-string "$CS" >/dev/null | ||
|
|
||
| ACL="$(az storage container show --name documents --connection-string "$CS" --query properties.publicAccess -o tsv || true)" | ||
| echo "documents publicAccess=$ACL" | ||
|
|
||
| echo "Seeded URL: http://azurite:10000/devstoreaccount1/documents/source.pdf" |
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.