This page should be a comprehensive guide to releasing a geodashboard project.

Step-by-step guide to complete release for mixed v2 and v3 system

  1. Development - Branches and Servers
    1. Geodashboard v2
      1. Core
        1. Geodashboard V2 is used for multiple projects
          1. release will be decided by larger group - contacts are Luigi MariniIndira Gutierrez Polo
          2. v2 should be on the most recent version of development branch on project's development server
          3. For creating a geodashboard (core) release. One of the committers needs to create a release branch. The release number should follow semantic versioning http://semver.org/. In the release branch there need to be the following 3 changes: 
            1. Update version number in project/Build.scala
            2. Update version number in package.json
            3. In Changelog.md update version number and add release date
          4. After the release branch is merged, a tag needs to be created in the master branch. Instructions for creating a tag are here: https://git-scm.com/book/en/v2/Git-Basics-Tagging 
          5. After creating the tag, create new branch, it's name could be custom 'master-to-develop-release-2.x.x' and merge that branch to develop. 
        2. Project specific configuration
          1. Create a project specific (gltg/ilnlrs/imlczo/seagrant) release branch. Follow semantic versioning to determine the number for the release: http://semver.org/. In the release branch there need to be 2 changes: 
            1. Update version number in package.json
            2. In changelog.md update version number and add release date
          2. After the release branch is merged, a tag needs to be created in the master branch. Instructions for creating a tag are here: https://git-scm.com/book/en/v2/Git-Basics-Tagging - The tag name for version 1.9.0 should be 'v1.9.0', add the letter v to indicate version before the release number for the tag. 
          3. After creating the tag, create new branch, it's name could be custom 'master-to-develop-release-2.x.x' and merge that branch to develop. 
      2. Build
        1. If set up with Puppet, the development server should update automatically to the most recent build
          1. If you need to update manually, ssh to the geodashboard developement server
          2. sudo /home/geodashboard/update-geodashboard.sh --force
    2. Geodashboard v3
      1. Software
        1. Each project should have a specific branch of v3 named by project name, which the master branch merged into the configuration 
          1. The master branch should be merged into the project branch which maintains it's specific configuration
      2. Build (local by user)
        1. git clone ssh://git@opensource.ncsa.illinois.edu:7999/geod/geodashboard-v3.git
          cd geodashboard-v3
          checkout <project specific branch name>
          yarn install
          yarn run build
        2. Copy the contents of the build directory of the system's proxy server

          1. check the nginx root directory
          2. more /etc/nginx/sites-enabled/<site> | grep root
            1. this returns the path to the nginx root directory

          3. cd to nginx root directory
          4. there should be a directory call 'gd3' (maybe named something else)
          5. backup the directory
          6. cp -r gd3 gd3_backup
          7. copy the new build files into the gd3 directory (delete the previous of just overwrite)
    3. Clowder 
      1. clowder on dev uses the clowder development branch
      2. should update automatically 
      3. to update manually
        1. sudo /home/clowder/update-clowder.sh --force
    4. TEST THE SITE!!!

  2. Development - Data
    1. Make sure all data is up to date and correct
    2. backup the database 
      1. On the database server:

        sudo -u postgres pg_dump <geostream db name > geostream-backup.sql 
      2. If not sure of the geostream database name, on the clowder server:

        more /home/clowder/clowder/custom/custom.conf | grep postgres.db
    3. Make sure the cache is updated.  If not sure run (this will take a while depending upon how much data there is):

      <host>/clowder/api/geostreams/cache
  3. Production - Branches and Servers (after thoroughly testing dev)

    1. Geodashboard
      1. Core - make sure the core master branch is ready
      2. project config
        1. Merge develop into master
      3. All software on production branches need to be updated manually on geodashboard server

        sudo /home/geodashboard/update-geodashboard.sh --force
    2. Clowder
      1. On clowder server

        sudo /home/clowder/update-clowder.sh --force
  4. Production - Data

    1. If there is new data on dev and you decide to move the dev database to prod database and move the dev cache to the prod cache:
      1. turn on maintenance page
      2. ssh into postgres machine
      3. backup development and production databases

        sudo -u postgres pg_dump geostream_dev > geostream_dev_$(date +"%Y-%m-%d").sql  		# took 42 minutes to create 6.8G db
        sudo -u postgres pg_dump geostream > geostream_$(date +"%Y-%m-%d").sql					# took 52 minutes to create 9.5G db
      4. Copy dev database to production temp database

        1. stop clowder on dev

        2. copy

          sudo -u postgres psql -c "create database geostream_prod_temp with template geostream_dev"
      5. delete the production database 

        1. Stop clowder on production machine and:

          sudo -u postgres dropdb geostream
      6. Rename production database

        1.  Stop clowder on dev machine

        2. sudo -u postgres psql -c "ALTER DATABASE geostream_prod_temp RENAME TO geostream;"
      7. Restart both clowder instances

      8. Copy cache from dev machine to prod machine
        1. on production machine delete cache
          1. option 1, use clowder endpoint
          2. option 2, on clowder machine delete cache files

            sudo rm /home/clowder/cache/*
        2. use ssh to copy cache from dev to production (rsync would be better) (using key would be better) .  On production machine:

          sudo scp <your_ubuntu_username_on_dev>@<dev_hostname>:/home/clowder/cache/* .
      9. turn off maintenance page