User Tools

Site Tools


tech2018:s3:dev_deploys

Deploys in test and production env

When you are confident that your solution in ready to go in test or production you should proceed with the deploy.

This is a script we suggest to use for an automated deploy. Please notice: this script does not handle SQL changes that you will have to do manually.

Script to deploy from BitBucket on a target folder called repo.wmanager.org

#!/bin/sh

d=$(date +"%Y-%m-%d_%H-%M-%S")

#deploy in a temp folder
/bin/mkdir /var/www/wmanager/repo.wmanager.org_temp


VAR=$(expect -c '
  spawn git clone -b develop --single-branch https://bitbucket.org/raghven/marketplace /var/www/wmanager/repo.wmanager.org_temp
  expect "Username for 'https://bitbucket.org':"
  send "adharsh.g@coddletech.com\r"
  expect "Password for 'https://adharsh.g@coddletech.com@bitbucket.org':"
  send "xxxxx\r"
  expect eof
')


#backup current folder and activate the new one
/bin/mv /var/www/wmanager/repo.wmanager.org /var/www/wmanager/repo.wmanager.org_pre_$d
/bin/mv /var/www/wmanager/repo.wmanager.org_temp /var/www/wmanager/repo.wmanager.org

#overwrite configurations from server side script
/bin/cp ./config/database.php "/var/www/wmanager/repo.wmanager.org/application/config/production/database.php"
/bin/cp ./config/config.php "/var/www/wmanager/repo.wmanager.org/application/config/production/config.php"
/bin/cp ./config/paypal.php "/var/www/wmanager/repo.wmanager.org/application/config/production/paypal.php"

/bin/ln -s  /var/www/wmanager/extension/pub/ /var/www/wmanager/repo.wmanager.org/pub
~                                                                                                                                                                                                                                   
~  

back to Tech2018/S3/The development workflow

tech2018/s3/dev_deploys.txt · Last modified: 2018/05/30 16:46 (external edit)