Skip to content

Instantly share code, notes, and snippets.

@spyl94
Last active November 25, 2015 17:28
Show Gist options
  • Save spyl94/d91a35f3aa808567ff7d to your computer and use it in GitHub Desktop.
Save spyl94/d91a35f3aa808567ff7d to your computer and use it in GitHub Desktop.
Migration plateforme v2
docker exec -it deploy_application_1 bash -c 'mysqldump --opt --single-transaction --host=database --user=deploy --password=$SYMFONY_DATABASE_PASSWORD capco_deploy' > dump.sql
instances=("mulhouse" "lechesnay" "nous-citoyens" "parlement-et-citoyens" "preprod" "demo" "keypeople" "lavaguecitoyenne" "democratie-ouverte" "ocpm" "jolicode" "mom21" "islean" "regionales2015" "republique-numerique" "rennes" "openlaw" "capco" "grenoble" "qcnum" "neo2017" "vincennes" "villas-robinson" "tarbes" "choisy" "vg-agglo" "drive");
for instance in "${instances[@]}"
do
eval "mkdir -p /home/capco/instances/${instance}"
eval "cp -R ~/CapCollectif-SF2/infrastructure/${instance}/files ~/instances/${instance}/files"
eval "chmod -R 777 ~/instances/${instance}/files/cache"
eval "cp -R ~/CapCollectif-SF2/infrastructure/${instance}/redis ~/instances/${instance}/redis"
done
./export_instances_db.sh
echo "" | crontab -
docker-compose -p deploy -f docker/environments/production.yml stop
docker-compose -p deploy -f docker/environments/production.yml rm -f
sudo nginx
docker images | awk '{print $3}' | xargs docker rmi
curl -sSL https://get.docker.com/ | sh
curl -L https://github.com/docker/compose/releases/download/1.5.1/run.sh > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
git pull
docker-compose -p deploy -f docker/environments/production.yml build
docker-compose -p deploy -f docker/environments/production.yml run builder build
sudo service nginx stop
docker-compose -p deploy -f docker/environments/production.yml up -d
sleep 15
fab docker_import_bdd
fab migrate
sleep 5
fab deploy:rennes
fab deploy:nous-citoyens
fab deploy:lavaguecitoyenne
fab deploy:republique-numerique
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment