From c93d61985c114050d632daef6c73686a69af7022 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Thu, 18 Apr 2024 06:21:11 -0400 Subject: [PATCH] Update README --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed0d881..d3069af 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Deploy your application from a CI/CD pipeline via `cURL` + JWT auth. ``` -$ curl -s -H "Authorization: bearer abc..." https://example.com/your/rollout/path +$ curl -s -d '{"git-branch": "main"}' -H "Authorization: bearer abc..." https://example.com/your/rollout/path Rollout complete ``` @@ -13,7 +13,7 @@ Instead of managing SSH keys in your CI/CD for accounts that have privileged acc Requires creating a JWT from your CI provider, and sending that token to this service running in your deployment environment to trigger a deployment script. -Also requires a `rollout.sh` script that can handle all the command needing ran to rollout your software. +Also requires a `rollout.sh` script that can handle all the commands needing ran to rollout your software. ## Install @@ -29,7 +29,7 @@ $ docker run \ ## OIDC Provider examples -This service requires two envionrment variables. +This service requires two environment variables. - `JWKS_URI` - the URL of the OIDC Provider's [JSON Web Key (JWK) set document](https://www.rfc-editor.org/info/rfc7517). This is used to ensure the JWT was signed by the provider. - `JWT_AUD` - the audience set in the JWT token. @@ -40,6 +40,28 @@ This service requires two envionrment variables. - `ROLLOUT_CMD` (default: `/bin/bash`) - the command to execute a rollout - `ROLLOUT_ARGS` (default: `/rollout.sh` ) - the args to pass to `ROLLOUT_CMD` +## Dynamic environment variables for ROLLOUT_CMD + +There are a few environment variables you can make available to your rollout command. + +These environment variables can be passed to the cURL command when rolling out your changes. + +For example, if you want your rollout script to have the git branch that is being deployed you can pass that in the rollout like so: + +``` +$ curl -s -d '{"git-branch": "main"}' -H "Authorization: bearer abc..." https://example.com/your/rollout/path +``` + +These are the environment variables currently supported, keyed by their respective JSON key name: + +- `docker-image` **:** `DOCKER_IMAGE` +- `docker-tag` **:** `DOCKER_TAG` +- `git-repo` **:** `GIT_REPO` +- `git-branch` **:** `GIT_BRANCH` +- `rollout-arg1` **:** `ROLLOUT_ARG1` +- `rollout-arg2` **:** `ROLLOUT_ARG2` +- `rollout-arg3` **:** `ROLLOUT_ARG3` + ### GitHub ```