From 985de883e03b92b94cfb8a94ebbf68dad1a3db2f Mon Sep 17 00:00:00 2001 From: Piotr Date: Thu, 3 Mar 2022 09:50:05 +0100 Subject: [PATCH] RS-449: Install expect (#114) * Install expect * Fix opening the PR in correct place * Add LANG to SKIP_KEYS --- .circleci/config.yml | 29 ++++++++++++++++------------- images/circleci-tools/constants.js | 1 + images/rox.Dockerfile | 1 + 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10f02908..e8bf0ec8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,15 @@ commands: fi popd tag="$(.circleci/get_tag.sh "$flavor")" + + # Open or update a PR and configure labels, assignees - this must happen before pushing code changes to the branch + .circleci/create_update_pr.sh \ + "${branch_name}" \ + "<< parameters.repo >>" \ + "Update apollo-ci image" \ + "Bump version of apollo-ci image used in CircleCI" \ + "ci-upgrade-tests" + pushd "/tmp/<< parameters.repo >>" sed -r -i "s@(.*)/apollo-ci:${prefix}[0-9].*@\1/apollo-ci:${tag} ${todo}@g" .circleci/config.yml @@ -73,26 +82,20 @@ commands: if [[ "$flavor" == "stackrox-build" ]] && [[ "<< parameters.repo >>" == "stackrox" ]]; then echo "${tag} ${todo}" > BUILD_IMAGE_VERSION + git add BUILD_IMAGE_VERSION fi - if git diff-index --quiet HEAD; then + if git diff-files --quiet; then echo "There are no changes to commit in the dependent repo" else - git commit -am "Bump apollo-ci:$flavor image tag to ${tag##:}" + printf "Committing diff:\n%s\n---End of diff" "$(git diff-files -p)" + # It may happen that the diff is empty and we still land in this if-branch (not sure why), + # thus adding `--allow-empty` to not fail the commiting in such cases + git commit --allow-empty -am "Bump apollo-ci:$flavor image tag to ${tag##:}" + git push origin "${branch_name}" fi done - git push origin "${branch_name}" - popd - - # Open or update a PR and configure labels, assignees - .circleci/create_update_pr.sh \ - "${branch_name}" \ - "<< parameters.repo >>" \ - "Update apollo-ci image" \ - "Bump version of apollo-ci image used in CircleCI" \ - "ci-upgrade-tests" - build-and-push-image: parameters: image-flavor: diff --git a/images/circleci-tools/constants.js b/images/circleci-tools/constants.js index 43f46860..cfa46897 100644 --- a/images/circleci-tools/constants.js +++ b/images/circleci-tools/constants.js @@ -14,6 +14,7 @@ export const SKIP_KEYS = [ "HOME", "IMAGE", "INFLUXDB_USER", + "LANG", "LOGNAME", "MOTD_SHOWN", "NO_PROXY", diff --git a/images/rox.Dockerfile b/images/rox.Dockerfile index c8bdc830..47d2d78a 100644 --- a/images/rox.Dockerfile +++ b/images/rox.Dockerfile @@ -20,6 +20,7 @@ RUN set -ex \ && apt-get install --no-install-recommends -y \ build-essential \ curl \ + expect \ lsof \ openjdk-8-jdk-headless \ unzip \