Skip to content

Instantly share code, notes, and snippets.

@leozz37
Last active October 2, 2020 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leozz37/d9b882c014e7ea6ca448889f2c1d12ca to your computer and use it in GitHub Desktop.
Save leozz37/d9b882c014e7ea6ca448889f2c1d12ca to your computer and use it in GitHub Desktop.
Travis file for deploying on AWS ECL
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
#!/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