Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Apr 19, 2024
1 parent dc21865 commit 5e7b6b5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ci/src/parameter-store-updater/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* Invoked by: EventBridge rule
*
* Runs every time the CI CodeBuild project reports a successful build. The
* final build environment is examined and, when necessary, identifiers for
* published code artifacts (like new ECR image tags, or new S3 objects) are
* sent to Parameter Store to update the corresponding **staging** environment
* parameter values.
*
* The Spire CD pipeline is generally triggered when staging parameters are
* changed, so the result of this is usually also a Spire deployment, but this
* Lambda isn't triggering that directly.
*
* (Production parameter values are never updated directly in this way, since
* we would only want those to update once the new build has been tested in the
* staging environment.)
*/

import { SSMClient, PutParameterCommand } from '@aws-sdk/client-ssm';

const ssm = new SSMClient({ apiVersion: '2014-11-06' });
Expand Down Expand Up @@ -84,6 +102,9 @@ export const handler = async (event) => {
// PRX_CI_PUBLISH will be true when the build is publishing some sort of
// deployable code artifact. Parameters only need to be updated when
// something has been published.
//
// Do **not** match on PRX_CI_PRERELEASE. The purpose of that flag is to skip
// parameter updates _even if_ artifacts have been published.
if (
allEnvars.PRX_CI_PUBLISH === 'true' &&
eventDetail['build-status'] === 'SUCCEEDED'
Expand Down

0 comments on commit 5e7b6b5

Please sign in to comment.