forked from Alv-no/alvtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·76 lines (62 loc) · 1.93 KB
/
run
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
set -e
KEY_VAULT="alvtimedev"
function getSecret() {
az keyvault secret show --vault-name "$KEY_VAULT" --name "$1" | jq '.value' -r
}
[ "up" = "$1" ] && \
docker-compose up
if [ "frontend" = "$1" ]; then
docker-compose up --detach frontend
docker-compose exec frontend npm start
fi
if [ "adminpanel" = "$1" ]; then
docker-compose up --detach adminpanel
docker-compose exec adminpanel npm start
fi
if [ "adminpanel-v2" = "$1" ]; then
docker-compose up --detach adminpanel-v2
docker-compose exec adminpanel-v2 npm start
fi
if [ "slack-app" = "$1" ]; then
NGROK_AUTH="$(getSecret ngrok-auth)"
export NGROK_AUTH
AZURE_AD_CLIENT_SECTRET="$(getSecret azure-ad-client-sectret)"
export AZURE_AD_CLIENT_SECTRET
HOST="$(getSecret host)"
export HOST
NGROK_HOSTNAME="$(getSecret ngrok-hostname)"
export NGROK_HOSTNAME
SLACK_BOT_TOKEN="$(getSecret slack-bot-token)"
export SLACK_BOT_TOKEN
SLACK_SIGNING_SECRET="$(getSecret slack-signing-secret)"
export SLACK_SIGNING_SECRET
LEARNING_COLLECTOR_SLACK_BOT_SIGNING_SECRET="$(getSecret learning-collector-slack-bot-signing-secret)"
export LEARNING_COLLECTOR_SLACK_BOT_SIGNING_SECRET
LEARNING_COLLECTOR_SLACK_BOT_TOKEN="$(getSecret learning-collector-slack-bot-token)"
export LEARNING_COLLECTOR_SLACK_BOT_TOKEN
CVPARTNER_API_TOKEN="$(getSecret cvpartner-api-token )"
export CVPARTNER_API_TOKEN
docker-compose up --detach slack-app
docker-compose exec slack-app bash
fi
[ "down" = "$1" ] && \
docker-compose down --volumes
[ "logs" = "$1" ] && \
docker-compose logs --follow
[ "prune" = "$1" ] && \
docker system prune --force
if [ "build" = "$1" ]; then
source scripts/buildServices.sh
fi
if [ "deploy" = "$1" ]; then
shift
source scripts/setup.sh "$1"
if [ "$1" == 'test' ]
then
source scripts/buildServices.sh
az acr login --name "$CONTAINER_REGISTRY"
source scripts/pushServices.sh
fi
source scripts/deployServices.sh
fi