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
# Source: https://forums.aws.amazon.com/thread.jspa?threadID=166904 | |
# S3 artifact | |
aws deploy create-deployment --application-name APPLICATION --deployment-group-name GROUP --ignore-application-stop-failures --s3-location bundleType=tar,bucket=BUCKET,key=KEY --description "Ignore ApplicationStop failures due to broken script" | |
# Github | |
aws deploy create-deployment --application-name APPLICATION --deployment-group-name GROUP --ignore-application-stop-failures --github-location commitId=`git rev-parse HEAD`,repository=ACCOUNT/PROJECT --description "Ignore ApplicationStop failures due to broken script" |
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 | |
until service codedeploy-agent status >/dev/null 2>&1; do | |
sleep 60 | |
rm -f install | |
wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
sudo ./install auto | |
service codedeploy-agent restart | |
done |
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 | |
sudo apt-get -y update | |
sudo apt-get -y install ruby | |
sudo apt-get -y install wget | |
cd /home/ubuntu | |
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install | |
sudo chmod +x ./install | |
sudo ./install auto | |
# update the packages index |
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
# Remove old version | |
sudo apt-get remove docker-compose | |
# Discover newest version | |
# sudo apt install jq | |
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) | |
DESTINATION=/usr/local/bin/docker-compose | |
# Fetch latest version and give it permission | |
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION |
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
Class.query.with_entities(Class.title).distinct() | |
titles = [r.title for r in session.query(Class.title).distinct()] | |
source:https://stackoverflow.com/questions/22275412/sqlalchemy-return-all-distinct-column-values |
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
sudo service ntp stop | |
sudo ntpdate -s time.nist.gov | |
sudo service ntp start |
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
git remote update | |
git branch | |
git checkout --track origin/<branch_you_want_to_switch_to> |
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
https://github.com/julianespinel/stockreader/wiki/Deploy-to-AWS-using-docker-machine-and-docker-compose | |
Deploy to AWS using docker-machine and docker-compose | |
1. Prepare your machine | |
Please follow this steps: | |
Install docker in your localhost. Installation link | |
Install docker-machine in your localhost. Installation link |
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
docker-compose rm -f | |
docker rmi -f $(docker images -qf dangling=true) | |
# Volumes | |
docker volume ls -f dangling=true | |
docker volume rm $(docker volume ls -f dangling=true -q) | |
# Compose in PROD | |
docker-compose -f docker-compose.yml -f production.yml up -d |