From 4219efa01bcdf0c70e71082bf77d0b9d53ac4e10 Mon Sep 17 00:00:00 2001 From: Eugene K Date: Tue, 12 Jan 2021 11:21:06 -0500 Subject: [PATCH 1/4] [WIP] Update CircleCI docker image Experimenting with CircleCI config to address stability issues when trying to install OpenJDK8 onto the ruby-buster docker image. --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 98cf25c74..5cc6bb814 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ orbs: references: base_container: &base_container docker: - - image: circleci/ruby:2.7.1-buster + - image: circleci/openjdk:8u265-jdk-buster ###################################################################################################################### # Build steps @@ -32,7 +32,7 @@ references: install_jdk: &install-jdk run: - name: install jdk 8 + name: install Ruby command: | sudo apt-get install -y wget gnupg software-properties-common # wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - @@ -41,8 +41,10 @@ references: # sudo apt-get install -y adoptopenjdk-8-hotspot texlive texlive-xetex texlive-latex-recommended texlive-latex-extra texlive-lang-cjk # # Steps above are commented out due to: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1399. Workaround below. - wget https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-8-hotspot/adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb - sudo apt install ./adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb + # wget https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-8-hotspot/adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb + # sudo apt install ./adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb + sudo apt-get update -y + sudo apt-get install -y ruby-full deploy_to_staging: &deploy-to-staging run: From 9512946a696ad1e3beea623b6bbfce75bec7f6bd Mon Sep 17 00:00:00 2001 From: Eugene K Date: Tue, 12 Jan 2021 11:25:01 -0500 Subject: [PATCH 2/4] Temporarily switch to deploying my branch to stage to force it to build in CircleCI fix the circleci config file more iteration more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. more iteration.. --- .circleci/config.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cc6bb814..c8f1f9e0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ orbs: references: base_container: &base_container docker: - - image: circleci/openjdk:8u265-jdk-buster + - image: circleci/ruby:2.7.1-buster ###################################################################################################################### # Build steps @@ -32,35 +32,33 @@ references: install_jdk: &install-jdk run: - name: install Ruby + name: install jdk 8 command: | - sudo apt-get install -y wget gnupg software-properties-common + sudo apt-get install -y wget # wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - # sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ - # sudo apt-get update -y + sudo apt-get update -y # sudo apt-get install -y adoptopenjdk-8-hotspot texlive texlive-xetex texlive-latex-recommended texlive-latex-extra texlive-lang-cjk # # Steps above are commented out due to: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1399. Workaround below. - # wget https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-8-hotspot/adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb - # sudo apt install ./adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb - sudo apt-get update -y - sudo apt-get install -y ruby-full + wget https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-8-hotspot/adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb + sudo apt install ./adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb deploy_to_staging: &deploy-to-staging run: name: deploy to staging command: | set +o pipefail - if [[ "$CIRCLE_BRANCH" == "master" ]]; then + # if [[ "$CIRCLE_BRANCH" == "master" ]]; then export CREDENTIALS=`aws sts assume-role --role-arn arn:aws:iam::151025255439:role/allow-gruntwork-website-ci-cd-access-from-other-accounts --role-session-name CircleCI --duration-seconds 900 --output=json` export AWS_ACCESS_KEY_ID=`echo ${CREDENTIALS} | jq -r '.Credentials.AccessKeyId'` export AWS_SECRET_ACCESS_KEY=`echo ${CREDENTIALS} | jq -r '.Credentials.SecretAccessKey'` export AWS_SESSION_TOKEN=`echo ${CREDENTIALS} | jq -r '.Credentials.SessionToken'` export AWS_EXPIRATION=`echo ${CREDENTIALS} | jq -r '.Credentials.Expiration'` ./push-to-s3-stage.sh - else - echo "not on master, skipping staging deploy" - fi + # else + # echo "not on master, skipping staging deploy" + # fi deploy_to_prod: &deploy-to-prod run: @@ -130,10 +128,10 @@ workflows: version: 2 each_commit: jobs: - - deploy-to-stage: - filters: - branches: - only: master + - deploy-to-stage + # filters: + # branches: + # only: master - deploy-to-prod: filters: tags: From efb600afa1befb27c888a84d7c400dbf1a0d0e32 Mon Sep 17 00:00:00 2001 From: Eugene K Date: Tue, 12 Jan 2021 13:05:47 -0500 Subject: [PATCH 3/4] remove temporary changes and remove unnecessary package installations which were causing issues --- .circleci/config.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8f1f9e0d..6e0b96c24 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,12 +35,6 @@ references: name: install jdk 8 command: | sudo apt-get install -y wget - # wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add - - # sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ - sudo apt-get update -y - # sudo apt-get install -y adoptopenjdk-8-hotspot texlive texlive-xetex texlive-latex-recommended texlive-latex-extra texlive-lang-cjk - # - # Steps above are commented out due to: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1399. Workaround below. wget https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-8-hotspot/adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb sudo apt install ./adoptopenjdk-8-hotspot_8u222-b10-2_amd64.deb @@ -49,16 +43,16 @@ references: name: deploy to staging command: | set +o pipefail - # if [[ "$CIRCLE_BRANCH" == "master" ]]; then + if [[ "$CIRCLE_BRANCH" == "master" ]]; then export CREDENTIALS=`aws sts assume-role --role-arn arn:aws:iam::151025255439:role/allow-gruntwork-website-ci-cd-access-from-other-accounts --role-session-name CircleCI --duration-seconds 900 --output=json` export AWS_ACCESS_KEY_ID=`echo ${CREDENTIALS} | jq -r '.Credentials.AccessKeyId'` export AWS_SECRET_ACCESS_KEY=`echo ${CREDENTIALS} | jq -r '.Credentials.SecretAccessKey'` export AWS_SESSION_TOKEN=`echo ${CREDENTIALS} | jq -r '.Credentials.SessionToken'` export AWS_EXPIRATION=`echo ${CREDENTIALS} | jq -r '.Credentials.Expiration'` ./push-to-s3-stage.sh - # else - # echo "not on master, skipping staging deploy" - # fi + else + echo "not on master, skipping staging deploy" + fi deploy_to_prod: &deploy-to-prod run: @@ -129,9 +123,9 @@ workflows: each_commit: jobs: - deploy-to-stage - # filters: - # branches: - # only: master + filters: + branches: + only: master - deploy-to-prod: filters: tags: From 84d6d78811d1e55d81d5261df438f1228d837ab2 Mon Sep 17 00:00:00 2001 From: Eugene K Date: Tue, 12 Jan 2021 13:12:13 -0500 Subject: [PATCH 4/4] fix syntax error --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e0b96c24..6acb784ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,7 +122,7 @@ workflows: version: 2 each_commit: jobs: - - deploy-to-stage + - deploy-to-stage: filters: branches: only: master