diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b0adaa6559..afe8eed35c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -24,6 +24,7 @@ services: - JWT_ISSUER - JWT_AUDIENCE - SECRET + - GITHUB_TOKEN depends_on: - traefik - redis diff --git a/tools/autodeployment/builds.js b/tools/autodeployment/builds.js index c846e5a8e0..8623178e76 100644 --- a/tools/autodeployment/builds.js +++ b/tools/autodeployment/builds.js @@ -73,19 +73,24 @@ function run() { // Promote the next build to current and start it const build = builds.pending; const { cache } = build; + const { GITHUB_TOKEN } = process.env; builds.current = build; builds.pending = null; logger.debug('run() called, starting pending build'); - build.proc = shell.exec(`./deploy.sh ${build.type} ${build.sha}`, { silent: true }, (code) => { - build.finish(code); - builds.previous = builds.current; - builds.current = null; - - // See if there's another build ready to go - run(); - }); + build.proc = shell.exec( + `./deploy.sh ${build.type} ${build.sha} ${GITHUB_TOKEN}`, + { silent: true }, + (code) => { + build.finish(code); + builds.previous = builds.current; + builds.current = null; + + // See if there's another build ready to go + run(); + } + ); // Combine stderr and stdout, like 2>&1 build.out = mergeStream(build.proc.stdout, build.proc.stderr); diff --git a/tools/autodeployment/deploy.sh b/tools/autodeployment/deploy.sh index 744c105da5..635f501fab 100755 --- a/tools/autodeployment/deploy.sh +++ b/tools/autodeployment/deploy.sh @@ -44,7 +44,7 @@ echo "Deleting $OLD Volumes" docker volume prune -f echo "Starting $ENV Environment" -docker-compose --env-file $ENV_FILE --project-name=$ENV up -d +GITHUB_TOKEN=$3 docker-compose --env-file $ENV_FILE --project-name=$ENV up -d echo "Removing dangling images" docker rmi $(docker images -f "dangling=true" -q) diff --git a/tools/autodeployment/env.example b/tools/autodeployment/env.example index 8ff79e448b..ec0aa683cc 100644 --- a/tools/autodeployment/env.example +++ b/tools/autodeployment/env.example @@ -16,3 +16,6 @@ UNSPLASH_CLIENT_ID= # Path to certificates PATH_TO_CERTS= + +# github access token +GITHUB_TOKEN=