-
Notifications
You must be signed in to change notification settings - Fork 4
/
dev
executable file
·61 lines (51 loc) · 1.79 KB
/
dev
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
#!/bin/sh
set -e
source secrets
eval $(carina env howtowhale-dev)
dvm use
read -r BASE_FROM < howtowhale-user/Dockerfile
BASE_TAG=${BASE_FROM#*:}
VERSION=$(git describe)
echo "### Cleanup from previous runs"
docker ps -qa --filter="name=howtowhale" | xargs docker rm -vf
echo "### Build the user's notebook server"
docker build -t carolynvs/howtowhale-user:$VERSION howtowhale-user/
docker push carolynvs/howtowhale-user:$VERSION
echo "### Run the static site"
docker build -t carolynvs/howtowhale-web:$VERSION howtowhale-web/
docker run --name howtowhale-web carolynvs/howtowhale-web:$VERSION
echo "### Build the hub"
docker build -t carolynvs/howtowhale-hub:$VERSION \
howtowhale-hub/
docker build -t carolynvs/howtowhale-proxy \
--build-arg domain=dev.howtowhale.com \
--build-arg affinity:container==letsencrypt-data \
howtowhale-proxy/
echo "### Spin up the hub"
docker run --name howtowhale-hub \
-d -p 8081:8081 \
--restart always \
--volumes-from swarm-data:ro \
-e VERSION=$VERSION \
-e DOMAIN=dev.howtowhale.com \
-e CARINA_OAUTH_HOST=oauth.getcarina.com \
-e OAUTH_CLIENT_ID=$CARINA_DEV_CLIENT_ID \
-e OAUTH_CLIENT_SECRET=$CARINA_DEV_CLIENT_SECRET \
-e DOCKER_HOST=https://${DOCKER_HOST#tcp://} \
-e JPY_COOKIE_SECRET=$JPY_COOKIE_SECRET \
-e DB_HOST=$DB_HOST \
-e DB_NAME=$DB_DEV_NAME \
-e DB_USERNAME=$DB_DEV_NAME \
-e DB_PASSWORD=$DB_DEV_PASSWORD \
carolynvs/howtowhale-hub:$VERSION
echo "### Spin up the proxy"
docker run --name howtowhale-proxy \
-d -p 80:80 -p 443:443 \
--restart always \
--link howtowhale-hub:howtowhale-hub \
--volumes-from letsencrypt-data \
--volumes-from howtowhale-web \
carolynvs/howtowhale-proxy
echo "# Cleanup my test user"
eval $(carina env howtowhale)
docker ps -qa --filter="name=howtowhale-carolynvs" | xargs docker rm -vf