Development & Deployment (for internal employees)

Deploy date: Bi-weekly on Tuesday night at 9pm EST.

All work/requests should follow the deployment process below. Deployments will happen on Tuesdays only unless a Hotfix for priority issue(s) arise. Please follow the steps listed below for local development and deployment:

Create branch from the jira ticket

  1. Click on “Create branch” in the right panel of the Jira ticket

    1. Choose Bitbucket settings

      1. Repository: Select applicable Bitbucket repository

      2. Type: Choose the applicable type. This should typically be “Release”. The system will automatically prefix it to your branch name.

      3. From branch: Select the branch you want to branch off of. Typically, this is the master branch.

      4. Branch name: This is automatically populated based on the selections above.

      5. Click Create

Bitbucket settings for creating a Branch directly from Jira ticket.

 

Do development work on local environment

Using your preferred IDE, make the necessary changes for the ticket. Please be sure to follow the https://relias.atlassian.net/wiki/spaces/UD/pages/2540831060/Local+Environment+Setup?atlOrigin=eyJpIjoiMThiMDY0Njg4M2M5NGU2NTk4YmExMTIyOTgzZTZmMTIiLCJwIjoiYyJ9 for instructions on how to get your local environment started.

In general, you will want to make a branch off of your release branch (which was created from the Jira ticket) to do work on a specific issue or project. Once that work is complete and you have tested the results on your local environment, you’ll merge that branch and any other project branches into your release branch for deployment (see below).

Deployment

Once you’ve completed work and tested the code on your local environment:

  1. Make backup of the production site within WPEngine

    1. Navigate to http://www.wpengine.com, click on sign in. Log in with your credentials.

    2. Navigate to production version of desired site

    3. Click on “backup points” from the left side menu

    4. Click on “Create backup”

    5. Within the pop-up:

      1. enter backup description (typically “deployment backup”)

      2. remove email addresses listed and only enter your email address. This is where the notification is sent that a backup has been created.

      3. Click “Create production backup”

    6. Once the backup has been created, you will receive an email notification. You may then navigate to WPEngine backup points, choose your recently created backup point, and click “prepare zip”.

    7. When the zip has been successfully created, you can then click on the download link to download the zipped version of the production environment.

  2. Must merge all working branches into release branch

    1. Make sure you are on your release branch

      1. git branch to verify

      2. git merge <working branch> to merge working branch into release branch

  3. Once all working branches are merged into the release branch, do some testing while on the release branch. Make sure your working branches (which are now all merged together on the release branch) do not cause any conflicts or issues.

  4. When ready, push your release branch to Bitbucket to begin the deployment build process

    1. git push origin <release branch>

    2. NOTE: We deploy our release branches, not the master branch. Master is treated as a final ledger for all approved and deployed work, and we merge our work into the master branch as part of our post-deployment cleanup process.

  5. Log into bitbucket.com and navigate to applicable repository.

  6. Click on “Deployments”

  7. Once the linter process has completed successfully, click Deploy beside development environment. This will trigger the code from the origin master branch to deploy to the development environment.

  8. After successfully deploying with no errors, please thoroughly check the environment to ensure the code deployment was successful and nothing looks incorrect.

  9. Once verified in development, you may now deploy to Staging. Click deploy beside the staging environment. This will trigger the code from the origin master branch to deploy to the staging environment.

  10. Repeat step 9

  11. Once verified in staging, you may now deploy to production. Click deploy beside the production environment. This will trigger the code from the origin master branch to deploy to the production environment.

  12. Once deployed, please thoroughly check the production environment for errors.

  13. Within Jira, navigate to your deployment ticket.

  14. Mark all deployed tickets listed within it as done.

  15. Add a comment to the deployment ticket, notifying Kristin and San that the tickets have been deployed.

Create Jira Deployment ticket for next sprint

  1. Click on “Create issue” within Jira

    1. Project: UX and Dev (UD)

    2. Issue Type: Development

    3. Summary: site release/branch-name | Sprint deployment (xx/xx - xx/xx)

      1. ex: relias.com release/2021-07-20 | Sprint deployment (7/7 - 7/20)

    4. Website: choose applicable site

    5. Url: enter URL

    6. UD Environment: choose production

    7. Due date: Enter date of deployment

    8. Priority: leave unset

    9. Type of issue: Site enhancement (may change to Site Enhancement in the future)

    10. Description: “Release ticket for {site} {date} deployment” then list links to all tasks included in deployment

    11. Stakeholder: list anyone that needs to know about tickets being deployed

    12. Assignee: yourself

    13. click create

    14. Find the ticket in the backlog and move it into the current sprint

    15. Create release branch directly from ticket (click “Create branch” on the right side panel). You’ll then be taken to bitbucket

    16. Repository: Ensure you’re using the right site

    17. Type: Release

    18. From branch: master (must have green check mark)

    19. Click create

    20. Copy the command to check out your branch. It should start with “git fetch && git checkout <branch name>”

    21. Within terminal, paste command. This creates the new branch locally.

Post Deployment Cleanup

After all deployments, please cleanup branches that have been merged and deployed to production. There is also a training video available of a post deployment cleanup.

  • To view all of your branches, types in “git branch”. The branch highlighted in green is the branch you’re currently on. Find all of the branches that were merged and up for deletion.

  • Delete unwanted branches from terminal on local environment

    • git branch -d <name of branch>

  • Delete unwanted branches from bitbucket

    • git push origin --delete <name of branch>

    • Do not delete the master branch from origin