From 616e31a3c782d58527e065f004d076f77d0f016d Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 22 Aug 2020 10:10:38 +0300 Subject: [PATCH 1/3] chore(ci): correctly compute the `DIST_TAG` environment variable Previously, the `DIST_TAG` environment variable was failing to be computed correctly, because it was using the non-existent `jq` tool. In the past (when running on TravisCI), `jq` used to be available, but it is not on the currently used CircleCI docker image, resulting in the following error: ```sh ./.circleci/env.sh: line 59: jq: command not found DIST_TAG= ``` You can see an example failure in the "Set up environment" step logs in https://app.circleci.com/pipelines/github/angular/angular.js/ 166/workflows/34c692ec-18d4-4422-a1cf-108a91219fa5/jobs/1742 This commit fixes it by using `node` (which _is_ available on the docker image) to compute `$DIST_TAG`. --- .circleci/env.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/env.sh b/.circleci/env.sh index 5ed01d3d2652..1948cb486ec7 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -56,12 +56,12 @@ setPublicVar SAUCE_READY_FILE_TIMEOUT 120 #################################################################################################### # Define additional environment variables #################################################################################################### -setPublicVar DIST_TAG $( jq ".distTag" "package.json" | tr -d "\"[:space:]" ) +setPublicVar DIST_TAG $( node --print "require('./package.json').distTag" ) #################################################################################################### #################################################################################################### ## Source `$BASH_ENV` to make the variables available immediately. ## -## ***NOTE: This must remain the the last action in this script*** ## +## ***NOTE: This must remain the last action in this script.*** ## #################################################################################################### #################################################################################################### source $BASH_ENV; From 7307eeda77daefefa6aeb99ef619c4edb12f3e3b Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 22 Aug 2020 10:28:18 +0300 Subject: [PATCH 2/3] chore(ci): fix docs deployment to Firebase (`deploy-docs` CI job) Previously, the command used to deploy the docs to Firebase (as part of the `deploy-docs` CI job) would fail, because no target project was specified (either directly in the command or indirectly via a `.firebaserc` file in the working directory). Example failure: https://app.circleci.com/pipelines/github/angular/angular.js/ 166/workflows/34c692ec-18d4-4422-a1cf-108a91219fa5/jobs/1744 This commit fixes the command by specifying the project via the `--project` cli argument. It also adds the commit SHA as message to make it easier to associate a deployment with the corresponding commit. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55a5622dd878..ac3538b2782f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -388,7 +388,7 @@ jobs: # Install dependencies for Firebase functions to prevent parsing errors during deployment # See https://github.com/angular/angular.js/pull/16453 - run: yarn --cwd scripts/docs.angularjs.org-firebase/functions - - run: yarn firebase deploy --token "$FIREBASE_TOKEN" --only hosting + - run: yarn firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --only hosting --project "docs-angularjs-org-9p2" --token "$FIREBASE_TOKEN" workflows: version: 2 From 986fd8c4e9f8ef7c67bde3d075b9c8870668f421 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 22 Aug 2020 17:02:30 +0300 Subject: [PATCH 3/3] fixup! chore(ci): correctly compute the `DIST_TAG` environment variable --- .circleci/env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/env.sh b/.circleci/env.sh index 1948cb486ec7..1bc4d118a6c2 100755 --- a/.circleci/env.sh +++ b/.circleci/env.sh @@ -61,7 +61,7 @@ setPublicVar DIST_TAG $( node --print "require('./package.json').distTag" ) #################################################################################################### #################################################################################################### ## Source `$BASH_ENV` to make the variables available immediately. ## -## ***NOTE: This must remain the last action in this script.*** ## +## *** NOTE: This must remain the last command in this script. *** ## #################################################################################################### #################################################################################################### source $BASH_ENV;