From 5d7df71d28aa506c5f2515da5469466b5b3e2eda Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:42:30 +0000 Subject: [PATCH] chore(circleci): remove python from common.sh and remove python dependency (#2102) --- .circleci/common.sh | 2 +- .circleci/config.yml | 11 ++++++----- .circleci/get_version.sh | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.circleci/common.sh b/.circleci/common.sh index 7b5987634..cea7aba96 100755 --- a/.circleci/common.sh +++ b/.circleci/common.sh @@ -8,7 +8,7 @@ DOCKER_FILE_NAME="$(echo ${DOCKER_IMAGE_TAG}_${IMAGE_VERSION_TAG} | sed -e 's/[^ # shellcheck disable=SC2068,SC2046 LAST_RELEASE="$(git describe --always --tags $(git rev-list --tags) | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)" # get the last release tag. FIXME: Fails if a commit is tagged with more than one tag: https://stackoverflow.com/questions/8089002/git-describe-with-two-tags-on-the-same-commit/56039163#56039163 # shellcheck disable=SC2034 -NEXT_RELEASE="$(echo "${LAST_RELEASE}" | python -c "parts = input().split('.'); parts[-1] = str(int(parts[-1])+1); print('.'.join(parts))")" +NEXT_RELEASE="$(echo "${LAST_RELEASE}" | awk -F. -v OFS=. '{$NF += 1 ; print}')" # shellcheck disable=SC2034 BRANCH_NAME_TRUNCATED="$(echo "${CIRCLE_BRANCH}" | cut -c -50 | sed 's/[^a-zA-Z0-9_.-]/_/g')" # docker has a 128 character tag limit, so ensuring the branch name will be short enough # shellcheck disable=SC2034 diff --git a/.circleci/config.yml b/.circleci/config.yml index 19ba96ee3..81ed5684b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -312,8 +312,8 @@ workflows: jobs: get-version: - docker: &docker-python-image - - image: cimg/python:3.12.1 + docker: &docker-base-image + - image: cimg/base:2024.02 working_directory: &work-dir /tmp/ci steps: - checkout @@ -771,7 +771,7 @@ jobs: ./.circleci/deployment/helm-chart-shell.nix docker-build: &build-job - docker: *docker-python-image + docker: *docker-base-image resource_class: medium working_directory: *work-dir steps: @@ -839,7 +839,7 @@ jobs: SPECKLE_SERVER_PACKAGE: docker-compose-ingress docker-publish: &publish-job - docker: *docker-python-image + docker: *docker-base-image resource_class: medium working_directory: *work-dir steps: @@ -948,7 +948,8 @@ jobs: command: 'yarn workspaces foreach -pv --no-private npm publish --access public' publish-helm-chart: - docker: *docker-python-image + docker: + - image: cimg/python:3.12.1 working_directory: *work-dir steps: - checkout diff --git a/.circleci/get_version.sh b/.circleci/get_version.sh index f722c6cec..1c89c2b4b 100755 --- a/.circleci/get_version.sh +++ b/.circleci/get_version.sh @@ -11,9 +11,9 @@ if [[ "${CIRCLE_TAG}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then fi if [[ "${CIRCLE_BRANCH}" == "main" ]]; then - echo "$NEXT_RELEASE-alpha.${CIRCLE_BUILD_NUM}" + echo "${NEXT_RELEASE}-alpha.${CIRCLE_BUILD_NUM}" exit 0 fi -echo "$NEXT_RELEASE-branch.${BRANCH_NAME_TRUNCATED}.${CIRCLE_BUILD_NUM}-${COMMIT_SHA1_TRUNCATED}" +echo "${NEXT_RELEASE}-branch.${BRANCH_NAME_TRUNCATED}.${CIRCLE_BUILD_NUM}-${COMMIT_SHA1_TRUNCATED}" exit 0