-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-cli
executable file
·33 lines (27 loc) · 1.45 KB
/
user-cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -e
## Try this with
# user-cli add-user test.user@example.com password
COMMAND_ARGS="$@"
source ./common/set_env
source ./common/fetch_and_set_secret_env AVENIR_NM_DB_PASSWORD AVENIR_NM_EMAIL_PASSWORD AVENIR_NM_ISSUE_REPORT_URL
# Get the key for storage account
STORAGE_ACCOUNT_KEY=$(az storage account keys list --resource-group $HINT_RESOURCE_GROUP --account-name $HINT_STORAGE_ACCOUNT | jq -r '.[0].value')
# Need to conncet to DB, and to have the config in a volume
az container create \
--resource-group $HINT_RESOURCE_GROUP \
--name hint-user-cli \
--image ghcr.io/mrc-ide/hint-user-cli:azure-entrypoint \
--command-line "/bin/sh -c '/userCLI/bin/userCLI $COMMAND_ARGS'" \
-e DB_URL=jdbc:postgresql://nm-hint-db.postgres.database.azure.com/hint \
HINTR_URL=http://nm-hintr \
APPLICATION_URL=https://nm-hint.icyfield-a41ed3df.eastus.azurecontainerapps.io \
AVENIR_NM_EMAIL_PASSWORD=$AVENIR_NM_EMAIL_PASSWORD \
AVENIR_NM_ISSUE_REPORT_URL=$AVENIR_NM_ISSUE_REPORT_URL \
AVENIR_NM_DB_PASSWORD=$AVENIR_NM_DB_PASSWORD \
--restart-policy Never \
--azure-file-volume-share-name config-share \
--azure-file-volume-account-name $HINT_STORAGE_ACCOUNT \
--azure-file-volume-account-key $STORAGE_ACCOUNT_KEY \
--azure-file-volume-mount-path /etc/hint \
--subnet "/subscriptions/f5e355bd-a7e7-4cfd-ad9f-ca5bc2ce3af2/resourceGroups/nmHint-RG/providers/Microsoft.Network/virtualNetworks/nm-hint-nw/subnets/nm-hint-db-migrate-subnet"