From c51ffb4778ba939f67b5908fb3e911c1f8df8810 Mon Sep 17 00:00:00 2001 From: Harry Smith Date: Fri, 28 Apr 2023 08:55:16 +0100 Subject: [PATCH] DWN-42625 : introduce Gresham Orb and update build executor image --- .circleci/README.md | 14 ++++++++++++++ .circleci/config.yml | 43 +++++++++++++++++++------------------------ 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 .circleci/README.md diff --git a/.circleci/README.md b/.circleci/README.md new file mode 100644 index 000000000..ccf24b6aa --- /dev/null +++ b/.circleci/README.md @@ -0,0 +1,14 @@ +# How to make changes? +##### Install the CircleCI CLI: +https://circleci.com/docs/2.0/local-cli/#installation + +##### Making a change +Change the areas of the .circleci/config.yml file that need to be edited + +##### To verify your changes +Any config can be verified, to ensure your changes are valid against the yaml and orb schemas, +from the root of the project, run: `circleci config validate .circleci/config.yml --org-slug gh/gresham-computing --token $CIRCLE_TOKEN` + +##### Possible errors: +- Your file must be encoded in UTF-8 (powershell defaulted to UTF-16) +- Must use Unix style line endings (LF, not CRLF) diff --git a/.circleci/config.yml b/.circleci/config.yml index 20e3ab9db..f3ef32cb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,15 +6,15 @@ parameters: default: false orbs: - aws-white-list-circleci-ip: configure/aws-white-list-circleci-ip@1.0.1 + gresham: gresham-computing/gresham-orb@5.1.0 executors: docker-executor: docker: - - image: 455456581940.dkr.ecr.eu-west-1.amazonaws.com/circleci-build-images:corretto-8u342 + - image: 399104266609.dkr.ecr.eu-west-1.amazonaws.com/circleci-build-images:corretto-8u342 aws_auth: - aws_access_key_id: $AWS_ACCESS_KEY_ID - aws_secret_access_key: $AWS_SECRET_ACCESS_KEY + aws_access_key_id: $GIS_PRD_ECR_INT_BUILD_ACCESS_KEY + aws_secret_access_key: $GIS_PRD_ECR_INT_BUILD_SECRET_ACCESS_KEY jobs: build-and-deploy: @@ -23,7 +23,9 @@ jobs: - checkout - get-maven-settings-file - restore-cache - - whitelist-add + - gresham/get-whitelister + - gresham/whitelist-add: + pattern: OpenId - run: name: "Setting Maven version" command: | @@ -43,7 +45,8 @@ jobs: - generate-download-urls: extension: jar - save-cache - - whitelist-remove + - gresham/whitelist-remove: + pattern: OpenId - persist-workspace test: @@ -52,27 +55,33 @@ jobs: - attach_workspace: at: . - restore-cache - - whitelist-add + - gresham/get-whitelister + - gresham/whitelist-add: + pattern: OpenId - run: name: "Running tests" command: mvn -fae -s gresham-nexus-settings/ctc.plugins.settings.xml test -B -V -U - save-test-results - save-cache - persist-workspace - - whitelist-remove + - gresham/whitelist-remove: + pattern: OpenId release: executor: docker-executor steps: - checkout - get-maven-settings-file - - whitelist-add + - gresham/get-whitelister + - gresham/whitelist-add: + pattern: OpenId - restore-cache - run: name: Creating openid-connect-server release and next snapshot command: chmod +x .circleci/cci_create_release_and_snapshot.sh && .circleci/cci_create_release_and_snapshot.sh - save-cache - - whitelist-remove + - gresham/whitelist-remove: + pattern: OpenId workflows: build-and-test: @@ -121,20 +130,6 @@ commands: git config --global url."https://api:${GITHUB_GRESHAM_PW}@github.com/".insteadOf "https://github.com/" git clone https://github.com/gresham-computing/gresham-nexus-settings - whitelist-add: - steps: - - aws-white-list-circleci-ip/add: - description: "${CIRCLE_PROJECT_REPONAME}-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}" - tag-key: "Name" - tag-value: "SG-CircleCi-CTC" - - whitelist-remove: - steps: - - aws-white-list-circleci-ip/remove: - description: "${CIRCLE_PROJECT_REPONAME}-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}" - tag-key: "Name" - tag-value: "SG-CircleCi-CTC" - save-cache: steps: - save_cache: