-
Notifications
You must be signed in to change notification settings - Fork 31
/
deploy.sh
24 lines (22 loc) · 991 Bytes
/
deploy.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
#!/bin/bash
# install docker cli
sudo apt install jq -y
curl -L -o docker-linux-amd64.tar.gz https://github.com/docker/compose-cli/releases/download/v1.0.10/docker-linux-amd64.tar.gz
tar xzf docker-linux-amd64.tar.gz
chmod +x docker/docker
which docker
sudo ln -s $(which docker) /usr/local/bin/com.docker.cli
./docker/docker --context default ps
sudo mv docker/docker /usr/local/bin/docker
docker version
# magic!
docker context create ecs ecsDocker${run_number} --from-env
docker context use ecsDocker${run_number}
docker compose -f docker-compose.yaml up
while [ -z "docker ps --filter status=running | grep app" ]; do sleep 1; done;
echo "App is ready!"
docker compose ps
# generate cloud formation templates
# docker compose -f docker-compose.yaml convert > aws-cloudformation.yaml
# aws cloudformation create-stack --stack-name ecsDocker${run_number} --template-body file://aws-cloudformation.yaml
# aws cloudformation wait stack-create-complete --stack-name ecsDocker${run_number}