Skip to main content

Deployment

Core GIT

Core environments

  • prod - Production environment
  • dev - Testing environment

Core git branches

  • prod - The latest stable version deployed to prod (production)
  • dev - Ready to test version deployed to dev (staging)
  • main - Master branch with the most up-to-date stable version (For archiving / backup purposes only)

General git Flows

Use feature/xxx or bug/xxx

First Steps

To start working on new feature/bug

  1. Assign JIRA Ticket and set to “In Development"
  2. Create new feature/xxx branch from release
  3. Work in the feature/xxx branch on all development, fixes or updates
  4. Regularly merge prod into feature/xxx to keep it up to date, commands:
    • git checkout feature/xxx
    • git fetch origin
    • git merge --no-ff origin/prod

Deploy feature for testing

When the feature is ready for testing, merge it into dev branch.

  1. Merge prod into the feature/xxx - to keep feature updated.

  2. Merge feature/xxx into the dev

  3. Deploy dev branch to dev environment.

    1. Navigate to front admin and/or front web where “deploy.sh” file is:

      cd <project_directory>/front-web
    2. Deploy:

      • Front End:

        ./deploy.sh dev
      • Back End (web-api):

        ./deploy.sh app-name stage-name
        For example:

        ./deploy.sh feeds-infrastructure dev
  4. Set the JIRA Ticket to "Ready for QA"

Release feature

If QA succeeds, merge the feature/xxx branch into the prod branch.

  1. Merge prod into the feature/xxx - to keep feature updated.

  2. Merge feature/xxx into the prod

  3. Deploy prod branch to prod environment.

    1. Navigate to front admin and/or front web where “deploy.sh” file is:

      cd <project_directory>/front-web
    2. Deploy:

      • Front End:

        ./deploy.sh prod
      • Back End (web-api):

        ./deploy.sh app-name stage-name
        For example:

        ./deploy.sh feeds-infrastructure prod
  4. Set JIRA Ticket to "Done"

Backup / Restore

Create Backup

The main branch is used for backup.
It is recommended to regularly merge the stable prod branch to main.

git checkout main && git merge prod

Restore Backup

If prod suddenly fails, you can always rollback to main:

git checkout main

Redeploy Front End:

./deploy.sh prod

Redeploy Back End:

./deploy.sh app-name stage-name
For example:

./deploy.sh feeds-infrastructure prod