-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
33 lines (32 loc) · 1.33 KB
/
buildspec.yml
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
version: 0.2
phases:
install:
runtime-versions:
docker: 18
python: 3.7
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
- echo "[+] Installing dependencies...."
- pip install -r requirements.txt
pre_build:
commands:
- echo "[+] Running tests..."
- python -m pytest test/ -v
- echo "[+] Logging in to Amazon ECR..."
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
build:
commands:
- echo "[+] Build started on `date`"
- echo "[+] Building the Docker image..."
- docker build -t wows:latest .
- docker tag wows:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/wows
post_build:
commands:
- echo "[+] Build completed on `date`"
- echo "[+] Pushing the Docker image.."
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/wows:latest
- echo "[+] Completed pushing Docker image. Deploying Docker image to AWS Fargate on `date`"
- printf '[{"name":"WOWS-Service","imageUri":"%s"}]' $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/wows:latest > imagedefinitions.json
artifacts:
files: imagedefinitions.json