From 640f8130b5680c45a31a6968d1857f2c4e6a562c Mon Sep 17 00:00:00 2001 From: Maya Raman Date: Wed, 24 Jan 2024 10:08:19 -0500 Subject: [PATCH 1/2] DOP-4242: Use release, not tag push for CI/CD (#968) * experiments, added nextGenParse call to jobHandler * stage ecs - no makefiles * alter snooty version * next gen html * command key * parse * catch * logger * remove error * more logging * cwd * repoDir correct * quotations * successful parse? odd address * oas page build * xlarge * persistence module * quote * no parse * try catch parse * type error * no parse, use persistence and build * log errors * localApp working * remove /dist * add build deps & nextgenhtml * add logging to build deps * log html * remove build deps for envs * env vars * build deps before executeBuild * staging monorepo jobs * comment * localApp type cleanup * stage * deploy * clean fs * status * no event body * throw new error * commented out all unnecessary steps * explicitly call build steps * remove steps that should not be used * include job inqueue for error * log status * Empty-Commit * comment * used process.env to find URL and BUCKET * save localApp * uncomment prepNextGenBuild * remove throw error * not build on preprd * buildCommands array * log publish * use normal deploy * deploy * add cp commands * cd snooty * log outputs * ref repoDir rather than cwd * correct reposDir vs repoDir * add slash * add repos to prodFileName * log build deps * change prodFIleName to cwd/snooty * run parse * remove deploy * override build in stagingJobHandler * override build, set up debugger * vscode launch * remove dist * remove dist * use project * readd build deps * add cp and cd commands to nextGenHtml * cp correct paths * remove first cp and cd * remove cp * ref snooty filepath correctly * dockerfile snooty branch mm-log * remove first cp * cd .. * commands * stringify, logs * use chdir * cp second * log in clicommand * pass logger to mut publish * dotcomstg -> stg * checkout and pull branch * add pull repo and change clone * commented out incorrect code * local run works for both cloud-docs and monorepo/cloud-docs * log event and boyd * log out trigger build * log repo name and feat flag * feature flag * ssmprefix * env * dist * remove feature flag for feature branch build * log why no paths * change slash of path * clean * organize code * clean * redoc * fixes from merge * comment out builddeps, use redoc rc * duplicate clone * clean, get bucket and url * log env vars * pass logger to getEnvVar * takeover preprd * add to v1? * log which build * force directory * add directory to debug command and local build * remove from preprd * clean up * keep conditionals for buildCommands in normal build * further cleaning * remove logs * number of logs * curl into repoDir/targetDir * try new flow of logging * remove comments * allow output and error text to be returned from nextGenStage * clean logs * revert targetDir for downloadBuildDependencies * clean, wrapWithBenchmark * PR feedback * [DOP-4127]: Update dockerfile.local to have redoc installed properly * [DOP-4127]: Use new SQS queue URL * [DOP-4127]: Install redoc bundle * [DOP-4127]: Revert how redoc is installed * PR feedback, second round * replace useWithBenchmarks with isNextGen * source patchId from getBuildAndGetDependencies * [DOP-4204]: Update README for local Autobuilder (#954) * [DOP-4204]: Add help command * [DOP-4204]: Typo * [DOP-4204]: Formatting * [DOP-4024]: Update README.md * [DOP-4204]: Troubleshooting * [DOP-4204]: Fix typos * [DOP-4204]: Rename images and move into shared folder * [DOP-4204]: Update troubleshooting * added logging and error throwing in wrapWithBenchmark * conditionally write patchId and commitHash env vars * changed instances of tag to release * merge conflixts again * and once more * Updating workflows README * Updating base README * updating readme * removing space, adding clarification --------- Co-authored-by: Matt Meigs Co-authored-by: branberry --- .github/workflows/README.md | 8 ++++++++ .github/workflows/deploy-prd-ecs.yml | 5 ++--- .github/workflows/deploy-prd-enhanced-webhooks.yml | 6 ++---- .github/workflows/deploy-prd-enhanced-worker.yml | 6 ++---- README.md | 3 ++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4d2719f8c..6aea90ae8 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -2,6 +2,14 @@ This README describes the various workflows defined for the docs-worker-pool repository. +## Releases + +The release process occurs whenever someone releases a specific tag (note: it does not run upon creation of a tag, only release). Three separate workflows are run upon release: + +1. `deploy-prd-ecs.yml` - Builds and deploys the old Autobuilder to prd +2. `deploy-prd-enhanced-webhooks.yml` - Builds and deploys webhooks (GitHub and Slack handlers) for the enhanced Autobuilder +3. `deploy-prd-enhanced-worker.yml` - Builds and deploys the Autobuilder worker to prd + ## Feature Branch Deploys The feature branch deploy process occurs whenever a developer opens a pull request. It consists of three separate workflows: diff --git a/.github/workflows/deploy-prd-ecs.yml b/.github/workflows/deploy-prd-ecs.yml index c6e96b9a2..68c751c87 100644 --- a/.github/workflows/deploy-prd-ecs.yml +++ b/.github/workflows/deploy-prd-ecs.yml @@ -1,7 +1,6 @@ on: - push: - tags: - - 'v*' + release: + types: [released] concurrency: group: environment-prd-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy-prd-enhanced-webhooks.yml b/.github/workflows/deploy-prd-enhanced-webhooks.yml index 6b0086fac..fc45d7d0c 100644 --- a/.github/workflows/deploy-prd-enhanced-webhooks.yml +++ b/.github/workflows/deploy-prd-enhanced-webhooks.yml @@ -1,8 +1,6 @@ on: - push: - tags: - - 'v*' - + release: + types: [released] concurrency: group: environment-prd-enhanced-webhooks-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/deploy-prd-enhanced-worker.yml b/.github/workflows/deploy-prd-enhanced-worker.yml index 90676eb1c..10eb08325 100644 --- a/.github/workflows/deploy-prd-enhanced-worker.yml +++ b/.github/workflows/deploy-prd-enhanced-worker.yml @@ -1,8 +1,6 @@ on: - push: - tags: - - 'v*' - + release: + types: [released] concurrency: group: environment-prd-enhanced-worker-${{ github.ref }} cancel-in-progress: true diff --git a/README.md b/README.md index ca199904b..6e5224e91 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,8 @@ docs-worker-pool contains various triggers for release to higher environments. C - Create release tags. We currently follow [semver](https://semver.org/) standards. - If you don't have push access, open an issue or otherwise contact a contributor with administrator privileges. -- Verify that the deploy-production-ec2 workflow executed successfully for both job runs across both production instances. +- Create a release associated with the tag using the GitHub UI or by running `gh release create`. +- Verify that the deploy-production-ec2 workflow executed successfully for both job runs across both production instances. The workflow should only run when a release is published. ### Serverless Development From 67116d109776095589487366edd4b9847e122f63 Mon Sep 17 00:00:00 2001 From: Cassidy Schaufele Date: Thu, 25 Jan 2024 13:52:44 -0700 Subject: [PATCH 2/2] Update Dockerfiles for new FE version --- Dockerfile | 2 +- Dockerfile.enhanced | 2 +- Dockerfile.local | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecd4ffded..7c079ca92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.15.2 -ARG SNOOTY_FRONTEND_VERSION=0.15.4 +ARG SNOOTY_FRONTEND_VERSION=0.15.6 ARG MUT_VERSION=0.10.7 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.enhanced b/Dockerfile.enhanced index 5eedb5d8c..505c84034 100644 --- a/Dockerfile.enhanced +++ b/Dockerfile.enhanced @@ -23,7 +23,7 @@ RUN cd ./modules/oas-page-builder \ FROM ubuntu:20.04 ARG WORK_DIRECTORY=/home/docsworker-xlarge ARG SNOOTY_PARSER_VERSION=0.15.2 -ARG SNOOTY_FRONTEND_VERSION=0.15.4 +ARG SNOOTY_FRONTEND_VERSION=0.15.6 ARG MUT_VERSION=0.10.7 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH diff --git a/Dockerfile.local b/Dockerfile.local index be9a615d7..f3b2bd7a8 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -2,7 +2,7 @@ FROM arm64v8/ubuntu:20.04 as initial ARG NPM_BASE_64_AUTH ARG NPM_EMAIL ARG SNOOTY_PARSER_VERSION=0.15.2 -ARG SNOOTY_FRONTEND_VERSION=0.15.4 +ARG SNOOTY_FRONTEND_VERSION=0.15.6 ARG MUT_VERSION=0.10.7 ARG REDOC_CLI_VERSION=1.2.3 ARG NPM_BASE_64_AUTH