-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (49 loc) · 1.73 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
42
43
44
45
46
47
48
49
sudo: required
dist: bionic
language: java
jdk:
- oraclejdk11
python:
- "3.6"
services: docker
before_install:
- sudo apt-get update
- cd 19\ RestWithSpringBootUdemy\ CI\ na\ AWS\ com\ o\ Travis\ CI/RestWithSpringBootUdemy/
- echo "Let's start Maven Package!"
- mvn clean package
- cd ..
- echo "We are in the Docker folder!!!"
script:
- echo "OK Here we GO!"
- docker-compose build
before_deploy:
- echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
deploy:
provider: script
script:
docker tag rest-with-spring-boot-udemy:latest tiagogomes187/rest-with-spring-boot-udemy:$TRAVIS_JOB_ID;
docker push tiagogomes187/rest-with-spring-boot-udemy:$TRAVIS_JOB_ID;
on:
branch: main
after_success:
- sudo apt-get -y install python3-pip python-dev
- sudo pip3 install -U setuptools
- sudo pip3 install -U virtualenvwrapper
- python3 -V
- pip3 -V
- pip3 uninstall wheel
- pip3 install wheel
- pip3 install awscli --upgrade --user
- export PATH=$PATH:$HOME/.local/bin
- eval aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin 730518124459.dkr.ecr.us-east-1.amazonaws.com
- docker tag rest-with-spring-boot-udamy:latest $IMAGE_REPO_URL:$TRAVIS_JOB_ID
- docker push $IMAGE_REPO_URL:$TRAVIS_JOB_ID
- add-apt-repository ppa:eugenesan/ppa
- apt-get update
- apt-get install jq -y
- curl https://raw.githubusercontent.com/silinternational/ecs-deploy/master/ecs-deploy | sudo tee -a /usr/bin/ecs-deploy
- sudo chmod +x /usr/bin/ecs-deploy
- echo "AWS ECS-Deploy Setup is Configured"
- ecs-deploy -c $CLUSTER_NAME -n $SERVICE_NAME -i $IMAGE_REPO_URL:$TRAVIS_JOB_ID -r $AWS_DEFAULT_REGION -t 240
notifications:
email: false