Kunstmaan / kStrano

kStrano (KumaStrano) is a Capistrano deployment “recipe” for Kunstmaan specific applications to make our job of deploying a lot easier. It integrates with Airbrake, Jenkins and Campfire.
MIT License
13 stars 0 forks source link

Clean install does not work #20

Closed roderik closed 11 years ago

roderik commented 11 years ago

Latest versions, no other versions installed. Ruby 1.9.3-p385

On the server: (zenit)

On the devbox:

This is the result:

[22:23:54][roderik@Thor ~/Development/kdeploy/bpodemo/data/bpodemo](master)$ cap production deploy
    triggering load callbacks
    triggering start callbacks for `production'
  * 2013-02-20 22:26:35 executing `production'
    triggering start callbacks for `deploy'
  * 2013-02-20 22:26:35 executing `multistage:ensure'
  * 2013-02-20 22:26:35 executing `deploy'
    triggering before callbacks for `deploy'
--> executing ssh-add
Identity added: /Users/roderik/.ssh/id_rsa (/Users/roderik/.ssh/id_rsa)
  * 2013-02-20 22:26:35 executing `kuma:changelog'
  * executing "ls -x /home/projects/bpodemo/data/releases"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 779ms
--> Are you sure you want to continue deploying? |y| y
  * 2013-02-20 22:26:38 executing `deploy:update'
 ** transaction: start
  * 2013-02-20 22:26:38 executing `deploy:update_code'
    triggering before callbacks for `deploy:update_code'
--> Updating code base with remote_cache strategy
  * executing "sudo -p 'sudo password: ' sh -c 'if [ -d /home/projects/bpodemo/data/shared/cached-copy ] ; then chown -R $SUDO_USER:$SUDO_USER /home/projects/bpodemo/data/shared/cached-copy; fi'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
Password: 
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 3574ms
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@git.kunstmaan.be:roderik.van.der.veer/bpodemo.git master"
    command finished in 1025ms
  * executing "if [ -d /home/projects/bpodemo/data/shared/cached-copy ]; then cd /home/projects/bpodemo/data/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 55d1a7ab18e2cc647c5cfa9e590a27889f6df796 && git clean -q -d -x -f; else git clone -q git@git.kunstmaan.be:roderik.van.der.veer/bpodemo.git /home/projects/bpodemo/data/shared/cached-copy && cd /home/projects/bpodemo/data/shared/cached-copy && git checkout -q -b deploy 55d1a7ab18e2cc647c5cfa9e590a27889f6df796; fi"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 1939ms
    copying the cached version to /home/projects/bpodemo/data/releases/20130220212645
  * executing "cp -RPp /home/projects/bpodemo/data/shared/cached-copy /home/projects/bpodemo/data/releases/20130220212645 && (echo 55d1a7ab18e2cc647c5cfa9e590a27889f6df796 > /home/projects/bpodemo/data/releases/20130220212645/REVISION)"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 91ms
  * 2013-02-20 22:26:45 executing `deploy:finalize_update'
    triggering before callbacks for `deploy:finalize_update'
  * executing "sudo -p 'sudo password: ' sh -c 'if [ -f /home/projects/bpodemo/data/releases/20130220212645/paramDecode ] ; then chmod -R ug+rx /home/projects/bpodemo/data/releases/20130220212645/paramDecode && cd /home/projects/bpodemo/data/releases/20130220212645 && ./paramDecode; elif [ -f /home/projects/bpodemo/data/releases/20130220212645/param ] ; then chmod -R ug+rx /home/projects/bpodemo/data/releases/20130220212645/param && cd /home/projects/bpodemo/data/releases/20130220212645 && ./param decode; fi'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 92ms
  * executing "sudo -p 'sudo password: ' chown -R bpodemo:bpodemo /home/projects/bpodemo/data/releases/20130220212645"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 91ms
  * executing "sudo -p 'sudo password: ' setfacl -R -m group:admin:rwx /home/projects/bpodemo/data/releases/20130220212645"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 83ms
  * executing "sudo -p 'sudo password: ' -u bpodemo chmod -R g+w /home/projects/bpodemo/data/releases/20130220212645"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 88ms
--> Creating cache directory
  * executing "sudo -p 'sudo password: ' -u bpodemo sh -c 'if [ -d /home/projects/bpodemo/data/releases/20130220212645/app/cache ] ; then rm -rf /home/projects/bpodemo/data/releases/20130220212645/app/cache; fi'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 78ms
  * executing "sudo -p 'sudo password: ' -u bpodemo sh -c 'mkdir -p /home/projects/bpodemo/data/releases/20130220212645/app/cache && chmod -R 0777 /home/projects/bpodemo/data/releases/20130220212645/app/cache'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 90ms
  * executing "sudo -p 'sudo password: ' -u bpodemo chmod -R g+w /home/projects/bpodemo/data/releases/20130220212645/app/cache"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 85ms
  * 2013-02-20 22:26:46 executing `deploy:share_childs'
--> Creating symlinks for shared directories
  * executing "sudo -p 'sudo password: ' -u bpodemo mkdir -p /home/projects/bpodemo/data/shared/app/logs"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 75ms
  * executing "sudo -p 'sudo password: ' -u bpodemo sh -c 'if [ -d /home/projects/bpodemo/data/releases/20130220212645/app/logs ] ; then rm -rf /home/projects/bpodemo/data/releases/20130220212645/app/logs; fi'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 78ms
  * executing "sudo -p 'sudo password: ' -u bpodemo ln -nfs /home/projects/bpodemo/data/shared/app/logs /home/projects/bpodemo/data/releases/20130220212645/app/logs"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 84ms
  * executing "sudo -p 'sudo password: ' -u bpodemo mkdir -p /home/projects/bpodemo/data/shared/web/uploads"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 93ms
  * executing "sudo -p 'sudo password: ' -u bpodemo sh -c 'if [ -d /home/projects/bpodemo/data/releases/20130220212645/web/uploads ] ; then rm -rf /home/projects/bpodemo/data/releases/20130220212645/web/uploads; fi'"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 78ms
  * executing "sudo -p 'sudo password: ' -u bpodemo ln -nfs /home/projects/bpodemo/data/shared/web/uploads /home/projects/bpodemo/data/releases/20130220212645/web/uploads"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 92ms
--> Normalizing asset timestamps
  * executing "sudo -p 'sudo password: ' -u bpodemo find /home/projects/bpodemo/data/releases/20130220212645/web/css /home/projects/bpodemo/data/releases/20130220212645/web/images /home/projects/bpodemo/data/releases/20130220212645/web/js -exec touch -t 201302202126.46 {} ';' &> /dev/null || true"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 56ms
    triggering after callbacks for `deploy:finalize_update'
  * 2013-02-20 22:26:46 executing `symfony:composer:install'
    triggering before callbacks for `symfony:composer:install'
  * 2013-02-20 22:26:46 executing `symfony:composer:copy_vendors'
--> Copying vendors from previous release
  * executing "vendorDir=/home/projects/bpodemo/data/current/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir /home/projects/bpodemo/data/releases/20130220212645/vendor; fi;"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 61ms
    triggering after callbacks for `symfony:composer:copy_vendors'
  * executing "sudo -p 'sudo password: ' chown -R bpodemo:bpodemo /home/projects/bpodemo/data/releases/20130220212645/vendor"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
 ** [out :: zenit.cloud.kunstmaan.com] chown: cannot access `/home/projects/bpodemo/data/releases/20130220212645/vendor': No such file or directory
    command finished in 76ms
*** [deploy:finalize_update] rolling back
  * executing "sudo -p 'sudo password: ' rm -rf /home/projects/bpodemo/data/releases/20130220212645; true"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
 ** [out :: zenit.cloud.kunstmaan.com] 
    command finished in 105ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/projects/bpodemo/data/releases/20130220212645; true"
    servers: ["zenit.cloud.kunstmaan.com"]
    [zenit.cloud.kunstmaan.com] executing command
    command finished in 52ms
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' chown -R bpodemo:bpodemo /home/projects/bpodemo/data/releases/20130220212645/vendor'" on zenit.cloud.kunstmaan.com
roderik commented 11 years ago

I think it fails with the copy vendors, there is no previous version

roderik commented 11 years ago

So it is, since cap production deploy:prefer:source works better

daanporon commented 11 years ago

he's going to copy the vendors from a previous install if it exists ... and in kStrano i chowned it to the project user ... but didn't check if the folder existed so i added an if statement around it ... new version available on rubygems.

We need to test this when a new project can be deployed ... because this will only fail the first time.