Skip to content

Latest commit

 

History

History
110 lines (72 loc) · 2.88 KB

UPGRADE.md

File metadata and controls

110 lines (72 loc) · 2.88 KB

Upgrade guide (0.5 to 0.6)

Automatic Upgrade

A Rake task is provided to automatically upgrade your application:

bundle exec rake orchestration:upgrade

Obsolete files will be removed and required modifications to existing files will be applied.

It is recommended to manually verify the validity of all changes to ensure that no custom configuration is lost.

Manual Upgrade

Delete/rename files

Delete all files from orchestration/ directory except:

  • docker-compose.production.yml
  • docker-compose.development.yml
  • docker-compose.test.yml
  • Dockerfile
  • entrypoint.sh

Rename:

orchestration/docker-compose.production.yml => orchestration/docker-compose.deployment.yml

Any environment-specific compose files (e.g. staging) should also be removed as the same compose file is now used for all deployment stages.

Update Makefile

Remove the first line of the main Makefile (in root of project) and replace it with the new include declaration:

OLD

include orchestration/Makefile

NEW

include $(shell bundle exec ruby -e 'require "orchestration/make"')

Post-setup target

Add a new target anywhere in the Makefile called post-setup:

.PHONY: post-setup
post-setup:
	echo 'doing post setup stuff'

Replace the body of this target with any commands that you want to take place once the initial setup (launching development/test containers, running migrations, etc.) is complete. For example, running migrations for a secondary database.

Update Dockerfile healthcheck

Edit orchestration/Dockerfile and edit the HEALTHCHECK directive's CMD to:

CMD ["bundle","exec","rake","orchestration:healthcheck"]

Continuous Integration files

Update any continuous integration scripts (e.g. Jenkinsfile) to run the setup target before test, e.g.:

OLD

    stage('Test') {
      steps {
        sh 'make test sidecar=1'
      }
    }

NEW

    stage('Test') {
      steps {
        sh 'make setup test sidecar=1'
      }
    }

(sidecar may or may not be needed depending on your setup but, if it was there prior to upgrade, then it should remain after upgrade).

General Usage

All Orchestration commands behave exactly the same as before with the exception of the test target. Now, instead of running make test to launch all containers and then run tests, Rubocop, etc., you must run make setup test.

This will set up the test environment and then run tests. You may then run make test to just run tests without having to go through the full setup process again.

Similarly you can set up the development environment by just running make setup.

To set up the test environment and run tests as two separate steps (i.e. equivalent of using the shorthand make setup test) you can run:

make setup RAILS_ENV=test
make test