Last active
October 2, 2020 01:18
-
-
Save leozz37/d9b882c014e7ea6ca448889f2c1d12ca to your computer and use it in GitHub Desktop.
Travis file for deploying on AWS ECL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
sudo: true | |
python: | |
- "3.8" | |
services: | |
- docker | |
before_script: | |
- pip install docker-compose | |
script: | |
- docker-compose run app sh -c "pytest test.py -p no:cacheprovider" | |
after_succes: | |
- coveralls | |
deploy: | |
provider: script | |
skip-cleanup: true | |
script: bash ci/travis-deploy.sh | |
on: | |
branch: master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# login DockerHub | |
docker login --username $DOCKER_HUB_USER --password $DOCKER_HUB_PASS | |
# Push Dockerfile to DockerHub | |
docker-compose build --pull | |
docker-compose push | |
# Installing AWS CLI | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip > /dev/null | |
sudo ./aws/install | |
# Login AWS | |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | |
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | |
aws configure set region $AWS_DEFAULT_REGION | |
# Update service | |
aws ecs update-service --cluster $ECS_CLUSTER_NAME --service $ECS_SERVICE_NAME --force-new-deployment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment