-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuildspec.yml
28 lines (27 loc) · 1.26 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
version: 0.2
phases:
install:
runtime-versions:
python: 3.9
commands:
- export DOCKERHUB_USER=$(aws secretsmanager get-secret-value --secret-id /creds/dockerhub --query SecretString --output text | jq -r '.DOCKERHUB_USER')
- export DOCKERHUB_PASS=$(aws secretsmanager get-secret-value --secret-id /creds/dockerhub --query SecretString --output text | jq -r '.DOCKERHUB_PASS')
- echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
pre_build:
commands:
- cd explorer-backend/
- pip install ".[dev,test]"
- pytest test/
- cd ..
build:
commands:
- echo Build started on `date`
- echo Building the Docker images...
- bin/docker_build.sh
- docker tag node-explorer:latest $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/node-explorer:latest
post_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/node-explorer:latest
- aws ecs update-service --cluster Mesh-Services --service Node-Explorer --force-new-deployment