forked from klauserber/coder-development-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_container.sh
executable file
·29 lines (23 loc) · 896 Bytes
/
run_container.sh
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
#!/usr/bin/env bash
. VERSION
# echo "pull image ${REGISTRY_NAME}/${IMAGE_NAME}:${TAG}"
# docker pull ${REGISTRY_NAME}/${IMAGE_NAME}:${TAG} > /dev/null
COMMAND=${1}
if [[ ! ${COMMAND} =~ ^(run_create|run_destroy|secrets_get|secrets_create|secrets_delete)$ ]]; then
echo "Usage: $0 COMMAND [google-project-name] [cluster-name]"
echo ""
echo " COMMANDS:"
echo " run_create - create a cluster"
echo " run_destroy - destroy a cluster"
echo " secrets_get - get the secrets from the google secret of a cluster"
echo " secrets_create - write the secrets to the google secret of a cluster"
echo " secrets_delete - delete the google secret of a cluster"
echo ""
exit 1
fi
docker run -it \
-v $(pwd)/config_default:/app/config_default \
-v $(pwd)/config:/app/config \
--rm \
--entrypoint=/app/${COMMAND}.sh \
${REGISTRY_NAME}/${IMAGE_NAME}:${TAG} ${@:2}