Building and Deploying Artifacts to AC - NCIOCPL/cgov-digital-platform GitHub Wiki

High-level Process

  1. Develop something on your own branch
  2. Create a Pull Request into a branch within the NCIOCPL/cgov-digital-platform repository.
    • During development this will either be the develop branch, feature branch, hotfix branch or a release branch.
  3. Wait for the status checks to pass.
  4. Spin up an ODE and let the product team know which environment to review
  5. Begin Review Cycle
    1. Product team reviews work and requests changes.
    2. Developers make changes pushing to their branch. This in turn automatically deploys to the ODE after passing tests.
  6. Pull request is approved, and code is merged into the branch.
    • This should initiate a build and deployment to the development server.

Spinning Up an On-Demand Environment (ODE)

  1. Login to the cloud dashboard, and go to the ncigovcd application.
  2. Click the + Add CD Environment button in the upper right
  3. Enter a Descriptive Name such as Blog Posts or something. Click Continue button.
  4. Select the pipelines-build-develop branch to start the ODE. Click the Continue button.
  5. Click Add Environment to accept the build.
    • You should see a new environment card appear on the list of environments. It will have a spinning arrow and be mostly white. It is provisioning and you can see the "status" in the Task Log under the Environment cards.
  6. Wait for the environment to finish spinning up.
  7. Click on the environment card.
  8. Click on Variables > Add Environment Variable, and add the PDQ_IMPORTER_PASS variable if you need the CDR to connect to your ODE.
  9. Scroll down to the SSH URL and copy it out.
  10. Open a command prompt and ssh into the server.
    1. cd ~
    2. Ensure that the two files, cgov-drupal-users.yml and slack_settings exist in the home directory.
      • If they do not exist, STOP! Feel free to document how to update those files if this happens to you.
        • Basically, copy the two files from the dev server.
    3. Log out.
  11. Go back to the main application screen where the listing of environments are.
  12. Go to your environment's card and click the Switch Code button (it is the one with the two arrows)
  13. Select the pipelines-build-pr-xxx branch which contains your deployment artifact. (NOTE: this is slightly different from what is in our GitHub codebase.)
  14. Click the Switch button
  15. Wait for "Switching Code" to finish and the environment is ready for use.