Skip to content
Anita Hapsari edited this page Nov 13, 2018 · 5 revisions

Requirements:

  • You can access the production server and staging server, and name it properly as staging.changelog.kartoza.com and changelog.kartoza.com by creating appropriate entries in your .ssh/config
  • You have develop branch
  • You have a remote repository called upstream that mapped to [email protected]:kartoza/prj.app.git

Deployment to Staging

  1. Go to deployment directory (i.e. prj.app/deployment)
  2. Check out develop branch and make sure it's up to date with develop branch in https://github.com/kartoza/prj.app.
  3. To make sure it is up to date, on your local develop branch do git pull and git fetch. It will update your local machine with the latest code and tag.
  4. Run ./tag_and_deploy_to_staging.sh to see the latest tag. Press CTRL+C to abort it. Sample output:
    estragon:deployment ismailsunni$ ./tag_and_deploy_to_staging.sh 
    Use this to tag a version on your local
    machine, push the tag upstream and then
    deploy it to the remote staging server.
    e.g.
    ./tag_and_deploy_to_staging.sh 1.2.3
    Last tag on your local system is:
    1.7.11
    New tag to be added to your local repo and pushed upstream:
    
    Are you sure you want to continue? 
    
    In that case, your current tag is 1.7.11.
  5. Decide the next tag, (e.g. 1.7.12). Then run ./tag_and_deploy_to_staging.sh 1.7.12. Press y to continue.
  6. Do migration to the staging server if needed:
    • Run ssh staging.changelog.kartoza.com
    • cd /home/projecta/deployment
    • make migrate
  7. Check and do some testing on the staging server.

Deployment to Production

  1. Go to deployment directory (i.e. prj.app/deployment)
  2. Check out develop branch and make sure it's up to date with develop branch in https://github.com/kartoza/prj.app
  3. Decide the version that you want to deploy, (e.g. 1.7.12). Then run ./deploy_to_production.sh 1.7.12. Press y to continue.
  4. Do migration to the production server if needed:
    • Run ssh changelog.kartoza.com
    • cd /home/projecta/deployment
    • make migrate
  5. Check and do some testing on the production server.
Clone this wiki locally