Skip to content

Instantly share code, notes, and snippets.

@METALLURG
Last active August 29, 2015 14:24
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 METALLURG/40a08369a2acce3f1768 to your computer and use it in GitHub Desktop.
Save METALLURG/40a08369a2acce3f1768 to your computer and use it in GitHub Desktop.
cap production deploy
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [46.101.249.187]
TASK: [apt | update] **********************************************************
ok: [46.101.249.187]
TASK: [apt | install dependencies] ********************************************
ok: [46.101.249.187] => (item=build-essential,libssl-dev,libyaml-dev,libreadline6-dev,zlib1g-dev,libcurl4-openssl-dev,git,nginx,redis-server,postgresql,postgresql-contrib,libpq-dev,imagemagick,libmagickwand-dev,nodejs,htop)
TASK: [account | create] ******************************************************
ok: [46.101.249.187]
TASK: [account | copy authorized keys] ****************************************
changed: [46.101.249.187]
TASK: [account | copy ssh private key] ****************************************
changed: [46.101.249.187]
TASK: [account | copy ssh public key] *****************************************
changed: [46.101.249.187]
TASK: [rbenv | clone repo] ****************************************************
changed: [46.101.249.187]
TASK: [rbenv | check ruby-build installed] ************************************
failed: [46.101.249.187] => {"changed": true, "cmd": ["test", "-x", "/home/deploy/.rbenv/plugins/ruby-build"], "delta": "0:00:00.002785", "end": "2015-07-11 19:27:38.207891", "rc": 1, "start": "2015-07-11 19:27:38.205106", "warnings": []}
...ignoring
TASK: [rbenv | add bin to path] ***********************************************
changed: [46.101.249.187]
TASK: [rbenv | init] **********************************************************
changed: [46.101.249.187]
TASK: [rbenv | clone ruby-build repo] *****************************************
changed: [46.101.249.187]
TASK: [rbenv | check ruby {{ ruby_version }} installed] ***********************
failed: [46.101.249.187] => {"changed": true, "cmd": "RBENV_ROOT=/home/deploy/.rbenv PATH=\"$RBENV_ROOT/bin:$PATH\" rbenv versions | grep 2.1.5", "delta": "0:00:00.033890", "end": "2015-07-11 19:27:43.745130", "rc": 1, "start": "2015-07-11 19:27:43.711240", "warnings": []}
stderr: Warning: no Ruby detected on the system
...ignoring
TASK: [rbenv | install ruby {{ ruby_version }}] *******************************
changed: [46.101.249.187]
TASK: [rbenv | set global ruby {{ ruby_version }}] ****************************
changed: [46.101.249.187]
TASK: [rbenv | rehash] ********************************************************
changed: [46.101.249.187]
TASK: [rbenv | create .gemrc] *************************************************
changed: [46.101.249.187]
TASK: [ruby | install bundler] ************************************************
changed: [46.101.249.187]
TASK: [rbenv | change owner] **************************************************
changed: [46.101.249.187]
TASK: [postgresql | check user] ***********************************************
failed: [46.101.249.187] => {"changed": true, "cmd": "psql -U postgres -c \"\\copyright\"", "delta": "0:00:00.148237", "end": "2015-07-11 19:36:00.014952", "rc": 2, "start": "2015-07-11 19:35:59.866715", "warnings": []}
stderr: psql: FATAL: Peer authentication failed for user "postgres"
...ignoring
TASK: [postgresql | set auth type] ********************************************
changed: [46.101.249.187]
TASK: [postgresql | restart service] ******************************************
changed: [46.101.249.187]
TASK: [postgresql | create shared directory] **********************************
changed: [46.101.249.187]
TASK: [postgresql | copy database.yml] ****************************************
changed: [46.101.249.187]
TASK: [postgresql | create database] ******************************************
changed: [46.101.249.187]
TASK: [rails | copy settings.yml] *********************************************
changed: [46.101.249.187]
TASK: [nginx | check config] **************************************************
failed: [46.101.249.187] => {"changed": true, "cmd": ["test", "-f", "/etc/nginx/sites-enabled/sample_app.conf"], "delta": "0:00:00.006764", "end": "2015-07-11 19:36:11.949032", "rc": 1, "start": "2015-07-11 19:36:11.942268", "warnings": []}
...ignoring
TASK: [nginx | createdir] *****************************************************
changed: [46.101.249.187]
TASK: [nginx | copy config] ***************************************************
changed: [46.101.249.187]
TASK: [nginx | restart service] ***********************************************
changed: [46.101.249.187]
PLAY RECAP ********************************************************************
46.101.249.187 : ok=30 changed=26 unreachable=0 failed=0
ansible-playbook -i46.101.249.187, playbook.yml
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [46.101.249.187]
TASK: [apt | update] **********************************************************
ok: [46.101.249.187]
TASK: [apt | install dependencies] ********************************************
ok: [46.101.249.187] => (item=build-essential,libssl-dev,libyaml-dev,libreadline6-dev,zlib1g-dev,libcurl4-openssl-dev,git,nginx,redis-server,postgresql,postgresql-contrib,libpq-dev,imagemagick,libmagickwand-dev,nodejs,htop)
TASK: [account | create] ******************************************************
ok: [46.101.249.187]
TASK: [account | copy authorized keys] ****************************************
changed: [46.101.249.187]
TASK: [account | copy ssh private key] ****************************************
ok: [46.101.249.187]
TASK: [account | copy ssh public key] *****************************************
ok: [46.101.249.187]
TASK: [rbenv | clone repo] ****************************************************
ok: [46.101.249.187]
TASK: [rbenv | check ruby-build installed] ************************************
changed: [46.101.249.187]
TASK: [rbenv | add bin to path] ***********************************************
skipping: [46.101.249.187]
TASK: [rbenv | init] **********************************************************
skipping: [46.101.249.187]
TASK: [rbenv | clone ruby-build repo] *****************************************
skipping: [46.101.249.187]
TASK: [rbenv | check ruby {{ ruby_version }} installed] ***********************
changed: [46.101.249.187]
TASK: [rbenv | install ruby {{ ruby_version }}] *******************************
skipping: [46.101.249.187]
TASK: [rbenv | set global ruby {{ ruby_version }}] ****************************
skipping: [46.101.249.187]
TASK: [rbenv | rehash] ********************************************************
skipping: [46.101.249.187]
TASK: [rbenv | create .gemrc] *************************************************
skipping: [46.101.249.187]
TASK: [ruby | install bundler] ************************************************
skipping: [46.101.249.187]
TASK: [rbenv | change owner] **************************************************
skipping: [46.101.249.187]
TASK: [postgresql | check user] ***********************************************
changed: [46.101.249.187]
TASK: [postgresql | set auth type] ********************************************
skipping: [46.101.249.187]
TASK: [postgresql | restart service] ******************************************
skipping: [46.101.249.187]
TASK: [postgresql | create shared directory] **********************************
skipping: [46.101.249.187]
TASK: [postgresql | copy database.yml] ****************************************
skipping: [46.101.249.187]
TASK: [postgresql | create database] ******************************************
skipping: [46.101.249.187]
TASK: [rails | copy settings.yml] *********************************************
ok: [46.101.249.187]
TASK: [nginx | check config] **************************************************
changed: [46.101.249.187]
TASK: [nginx | createdir] *****************************************************
skipping: [46.101.249.187]
TASK: [nginx | copy config] ***************************************************
skipping: [46.101.249.187]
TASK: [nginx | restart service] ***********************************************
skipping: [46.101.249.187]
PLAY RECAP ********************************************************************
46.101.249.187 : ok=13 changed=5 unreachable=0 failed=0
INFO [ad2bffb3] Running /usr/bin/env mkdir -p /tmp/sample_app/ as deploy@46.101.249.187
INFO [ad2bffb3] Finished in 0.108 seconds with exit status 0 (successful).
INFO Uploading /tmp/sample_app/git-ssh.sh 100.0%
INFO [a6940f20] Running /usr/bin/env chmod +x /tmp/sample_app/git-ssh.sh as deploy@46.101.249.187
INFO [a6940f20] Finished in 0.109 seconds with exit status 0 (successful).
INFO [55e50ee6] Running /usr/bin/env git ls-remote --heads https://github.com/METALLURG/sample_app.git as deploy@46.101.249.187
INFO [55e50ee6] Finished in 0.740 seconds with exit status 0 (successful).
INFO [a8315a0c] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/shared /home/deploy/applications/sample_app/releases as deploy@46.101.249.187
INFO [a8315a0c] Finished in 0.109 seconds with exit status 0 (successful).
INFO [c07405b6] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/shared/bin /home/deploy/applications/sample_app/shared/log /home/deploy/applications/sample_app/shared/tmp/pids /home/deploy/applications/sample_app/shared/tmp/cache /home/deploy/applications/sample_app/shared/tmp/sockets /home/deploy/applications/sample_app/shared/vendor/bundle /home/deploy/applications/sample_app/shared/public/uploads as deploy@46.101.249.187
INFO [c07405b6] Finished in 0.110 seconds with exit status 0 (successful).
INFO [8d5a4b1d] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/shared/config /home/deploy/applications/sample_app/shared/config as deploy@46.101.249.187
INFO [8d5a4b1d] Finished in 0.108 seconds with exit status 0 (successful).
INFO The repository mirror is at /home/deploy/applications/sample_app/repo
INFO [3a337650] Running /usr/bin/env git remote update as deploy@46.101.249.187
INFO [3a337650] Finished in 0.780 seconds with exit status 0 (successful).
INFO [27e84e89] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/releases/20150711235005 as deploy@46.101.249.187
INFO [27e84e89] Finished in 0.108 seconds with exit status 0 (successful).
INFO [c02c4786] Running /usr/bin/env git archive master | tar -x -f - -C /home/deploy/applications/sample_app/releases/20150711235005 as deploy@46.101.249.187
INFO [c02c4786] Finished in 0.128 seconds with exit status 0 (successful).
INFO [f2588a21] Running /usr/bin/env echo "7777d16" >> REVISION as deploy@46.101.249.187
INFO [f2588a21] Finished in 0.110 seconds with exit status 0 (successful).
INFO [296825e8] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/releases/20150711235005/config /home/deploy/applications/sample_app/releases/20150711235005/config as deploy@46.101.249.187
INFO [296825e8] Finished in 0.109 seconds with exit status 0 (successful).
INFO [321eec98] Running /usr/bin/env rm /home/deploy/applications/sample_app/releases/20150711235005/config/database.yml as deploy@46.101.249.187
INFO [321eec98] Finished in 0.123 seconds with exit status 0 (successful).
INFO [29af4456] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/config/database.yml /home/deploy/applications/sample_app/releases/20150711235005/config/database.yml as deploy@46.101.249.187
INFO [29af4456] Finished in 0.108 seconds with exit status 0 (successful).
INFO [b976cee4] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/config/settings.yml /home/deploy/applications/sample_app/releases/20150711235005/config/settings.yml as deploy@46.101.249.187
INFO [b976cee4] Finished in 0.109 seconds with exit status 0 (successful).
INFO [ba77daff] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/releases/20150711235005 /home/deploy/applications/sample_app/releases/20150711235005 /home/deploy/applications/sample_app/releases/20150711235005/tmp /home/deploy/applications/sample_app/releases/20150711235005/tmp /home/deploy/applications/sample_app/releases/20150711235005/tmp /home/deploy/applications/sample_app/releases/20150711235005/vendor /home/deploy/applications/sample_app/releases/20150711235005/public as deploy@46.101.249.187
INFO [ba77daff] Finished in 0.111 seconds with exit status 0 (successful).
INFO [d5a7fa40] Running /usr/bin/env rm -rf /home/deploy/applications/sample_app/releases/20150711235005/bin as deploy@46.101.249.187
INFO [d5a7fa40] Finished in 0.108 seconds with exit status 0 (successful).
INFO [6382dd29] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/bin /home/deploy/applications/sample_app/releases/20150711235005/bin as deploy@46.101.249.187
INFO [6382dd29] Finished in 0.108 seconds with exit status 0 (successful).
INFO [0fde7973] Running /usr/bin/env rm -rf /home/deploy/applications/sample_app/releases/20150711235005/log as deploy@46.101.249.187
INFO [0fde7973] Finished in 0.127 seconds with exit status 0 (successful).
INFO [5cb1676b] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/log /home/deploy/applications/sample_app/releases/20150711235005/log as deploy@46.101.249.187
INFO [5cb1676b] Finished in 0.111 seconds with exit status 0 (successful).
INFO [3c6b3a84] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/tmp/pids /home/deploy/applications/sample_app/releases/20150711235005/tmp/pids as deploy@46.101.249.187
INFO [3c6b3a84] Finished in 0.109 seconds with exit status 0 (successful).
INFO [7f421b91] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/tmp/cache /home/deploy/applications/sample_app/releases/20150711235005/tmp/cache as deploy@46.101.249.187
INFO [7f421b91] Finished in 0.109 seconds with exit status 0 (successful).
INFO [cffb8544] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/tmp/sockets /home/deploy/applications/sample_app/releases/20150711235005/tmp/sockets as deploy@46.101.249.187
INFO [cffb8544] Finished in 0.109 seconds with exit status 0 (successful).
INFO [210f51ad] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/vendor/bundle /home/deploy/applications/sample_app/releases/20150711235005/vendor/bundle as deploy@46.101.249.187
INFO [210f51ad] Finished in 0.110 seconds with exit status 0 (successful).
INFO [a2366ad0] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/shared/public/uploads /home/deploy/applications/sample_app/releases/20150711235005/public/uploads as deploy@46.101.249.187
INFO [a2366ad0] Finished in 0.109 seconds with exit status 0 (successful).
INFO [f559de41] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.5 ~/.rbenv/bin/rbenv exec bundle install --path /home/deploy/applications/sample_app/shared/bundle --without development test --deployment --quiet as deploy@46.101.249.187
INFO [f559de41] Finished in 0.955 seconds with exit status 0 (successful).
INFO [dfd23217] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.5 ~/.rbenv/bin/rbenv exec bundle exec rake assets:precompile as deploy@46.101.249.187
INFO [dfd23217] Finished in 4.320 seconds with exit status 0 (successful).
INFO [213a2e3c] Running /usr/bin/env mkdir -p /home/deploy/applications/sample_app/releases/20150711235005/assets_manifest_backup as deploy@46.101.249.187
INFO [213a2e3c] Finished in 0.110 seconds with exit status 0 (successful).
INFO [95826b89] Running /usr/bin/env cp /home/deploy/applications/sample_app/releases/20150711235005/public/assets/manifest-949a078a300b8b8ab41d86647b277f31.json /home/deploy/applications/sample_app/releases/20150711235005/assets_manifest_backup as deploy@46.101.249.187
INFO [95826b89] Finished in 0.109 seconds with exit status 0 (successful).
INFO [deploy:migrate] Run `rake db:migrate`
INFO [15c22e39] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.5 ~/.rbenv/bin/rbenv exec bundle exec rake db:migrate as deploy@46.101.249.187
INFO [15c22e39] Finished in 2.763 seconds with exit status 0 (successful).
INFO [35c81c66] Running /usr/bin/env ln -s /home/deploy/applications/sample_app/releases/20150711235005 /home/deploy/applications/sample_app/releases/current as deploy@46.101.249.187
INFO [35c81c66] Finished in 0.109 seconds with exit status 0 (successful).
INFO [7c1b8ed2] Running /usr/bin/env mv /home/deploy/applications/sample_app/releases/current /home/deploy/applications/sample_app as deploy@46.101.249.187
INFO [7c1b8ed2] Finished in 0.110 seconds with exit status 0 (successful).
INFO [2131b339] Running /usr/bin/env echo "Branch master (at 7777d16) deployed as release 20150711235005 by metallurg" >> /home/deploy/applications/sample_app/revisions.log as deploy@46.101.249.187
INFO [2131b339] Finished in 0.107 seconds with exit status 0 (successful).
INFO using conf file /home/deploy/applications/sample_app/shared/puma.rb
INFO [e06feacb] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.5 ~/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/applications/sample_app/shared/puma.rb --daemon as deploy@46.101.249.187
INFO [e06feacb] Finished in 0.809 seconds with exit status 0 (successful).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment