diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index c91b15f..4ded592 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -1,6 +1,6 @@ version: 2.1 orbs: - orb-tools: circleci/orb-tools@12.0 + orb-tools: circleci/orb-tools@12.2 jq: {} filters: &filters tags: @@ -14,15 +14,24 @@ executors: docker-base: docker: - image: cimg/base:stable + shell: bash -eox pipefail alpine: docker: - image: alpine:latest + shell: sh -eox pipefail macos: macos: xcode: 14.2.0 + shell: bash -eox pipefail machine: machine: image: ubuntu-2004:current + shell: bash -eox pipefail + arm: + machine: + image: ubuntu-2004:current + resource_class: arm.medium + shell: bash -eox pipefail jobs: install: @@ -32,11 +41,15 @@ jobs: version: type: string default: latest + override: + type: boolean + default: false executor: <> steps: - jq/install: version: <> - + override: <> + - checkout workflows: integration_tests-prod_deploy: jobs: @@ -60,7 +73,13 @@ workflows: name: install-latest-docker executor: docker-base context: orb-publisher - + - install: + name: install-jq-1.7-<> + matrix: + parameters: + executor: [alpine, macos, machine, docker-base, arm] + version: jq-1.7 + override: true # older jq - install: name: install-older-alpine diff --git a/src/scripts/install.sh b/src/scripts/install.sh index be88e78..7d229c7 100644 --- a/src/scripts/install.sh +++ b/src/scripts/install.sh @@ -1,10 +1,10 @@ #!/bin/sh #shellcheck disable=SC1090,SC3028 # Quietly try to make the install directory. -mkdir -p "${JQ_EVAL_INSTALL_DIR}" JQ_STR_VERSION="$(echo "${JQ_STR_VERSION}" | circleci env subst)" JQ_EVAL_INSTALL_DIR="$(eval echo "${JQ_EVAL_INSTALL_DIR}")" +mkdir -p "${JQ_EVAL_INSTALL_DIR}" # Selectively export the SUDO command, depending if we have permission # for a directory and whether we're running alpine. @@ -51,10 +51,14 @@ JQ_VERSION_NUMBER="$(echo "$JQ_VERSION_NUMBER_STRING" | awk '{print $2}')" # Set binary download URL for specified version # handle mac version if uname -a | grep Darwin > /dev/null 2>&1; then - JQ_BINARY_URL="https://github.com/jqlang/jq/releases/download/${JQ_VERSION}/jq-osx-amd64" + JQ_BINARY_URL="https://github.com/jqlang/jq/releases/download/${JQ_VERSION}/jq-macos-arm64" else # linux version - JQ_BINARY_URL="https://github.com/jqlang/jq/releases/download/${JQ_VERSION}/jq-linux64" + if uname -m | grep x86_64 > /dev/null 2>&1; then + JQ_BINARY_URL="https://github.com/jqlang/jq/releases/download/${JQ_VERSION}/jq-linux64" + else + JQ_BINARY_URL="https://github.com/jqlang/jq/releases/download/${JQ_VERSION}/jq-linux-arm64" + fi fi jqBinary="jq-$PLATFORM" @@ -63,14 +67,16 @@ if [ -d "$JQ_VERSION/sig" ]; then # import jq sigs if uname -a | grep Darwin > /dev/null 2>&1; then - HOMEBREW_NO_AUTO_UPDATE=1 brew install gnupg coreutils - - PLATFORM=osx-amd64 + HOMEBREW_NO_AUTO_UPDATE=1 brew install gnupg coreutils + PLATFORM=macos-arm64 else - if grep "Alpine" /etc/issue > /dev/null 2>&1; then - $SUDO apk add gnupg > /dev/null 2>&1 - fi - PLATFORM=linux64 + if grep "Alpine" /etc/issue > /dev/null 2>&1; then + $SUDO apk add gnupg > /dev/null 2>&1 + elif uname -m | grep x86_64 > /dev/null 2>&1; then + PLATFORM=linux64 + else + PLATFORM=linux-arm64 + fi fi gpg --import "$JQ_VERSION/sig/jq-release.key" > /dev/null