-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (39 loc) · 1.99 KB
/
.travis.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
34
35
36
37
38
39
40
41
sudo: required
language: generic
env:
- AWS_ECR_URL=542236349330.dkr.ecr.eu-south-1.amazonaws.com
services:
- docker
before_install:
- docker build -t andreadadru/client-test -f ./client/Dockerfile.dev ./client
script:
- docker run -e CI=true andreadadru/client-test npm test -- --coverage
after_success:
#- eval $(aws ecr get-login --no-include-email --region eu-south-1)
# install awscli v2 if not available
- ./ecr_credentials.sh
- if ! [ -x "$(command -v aws)" ]; then curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" ; unzip awscliv2.zip ; sudo ./aws/install ; fi
- docker login -u AWS -p $(aws ecr get-login-password --region eu-south-1) $AWS_ECR_URL
- docker build -t $AWS_ECR_URL/multi-client:$TRAVIS_BUILD_ID -t $AWS_ECR_URL/multi-client:latest ./client
- docker build -t $AWS_ECR_URL/multi-nginx:$TRAVIS_BUILD_ID -t $AWS_ECR_URL/multi-nginx:latest ./nginx
- docker build -t $AWS_ECR_URL/multi-server:$TRAVIS_BUILD_ID -t $AWS_ECR_URL/multi-server:latest ./server
- docker build -t $AWS_ECR_URL/multi-worker:$TRAVIS_BUILD_ID -t $AWS_ECR_URL/multi-worker:latest ./worker
#- docker tag andreadaru/multi-client:$TRAVIS_BUILD_ID $AWS_ECR_URL/multi-client:$TRAVIS_BUILD_ID
#- docker tag andreadaru/multi-nginx:$TRAVIS_BUILD_ID $AWS_ECR_URL/multi-nginx:$TRAVIS_BUILD_ID
#- docker tag andreadaru/multi-server:$TRAVIS_BUILD_ID $AWS_ECR_URL/multi-server:$TRAVIS_BUILD_ID
#- docker tag andreadaru/multi-worker:$TRAVIS_BUILD_ID $AWS_ECR_URL/multi-worker:$TRAVIS_BUILD_ID
- docker push $AWS_ECR_URL/multi-client --all-tags
- docker push $AWS_ECR_URL/multi-nginx --all-tags
- docker push $AWS_ECR_URL/multi-server --all-tags
- docker push $AWS_ECR_URL/multi-worker --all-tags
deploy:
provider: elasticbeanstalk
region: "eu-south-1"
app: "multi-docker"
env: "Multi-docker-env"
bucket_name: 'elasticbeanstalk-eu-south-1-542236349330'
bucket_path: 'docker-multi'
on:
branch: main
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY