From 519a9a02f9198f6c2542bc6127b5a604883a8528 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 23 Sep 2024 13:22:43 -0400 Subject: [PATCH 1/4] fix quickstart ziti version --- .github/workflows/release-quickstart.yml | 47 ++++++++++--------- .../linux/openziti-router/bootstrap.env | 2 +- quickstart/docker/createLocalImage.sh | 4 +- quickstart/docker/image/ziti-cli-functions.sh | 11 +++-- quickstart/docker/pushLatestDocker.sh | 17 ++++--- quickstart/test/compose-test.zsh | 2 +- 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release-quickstart.yml b/.github/workflows/release-quickstart.yml index 223c9a43a..3d3a53970 100644 --- a/.github/workflows/release-quickstart.yml +++ b/.github/workflows/release-quickstart.yml @@ -12,14 +12,18 @@ on: jobs: release-quickstart: name: Release Quickstart Job - # this is only run on the official upstream repo when a PR is merged to the default branch "main" or a release tag - # is pushed; merges to main trigger a quickstart release with a commit SHA suffix featuring the previous ziti binary - # release version, whereas release tag pushes trigger a quickstart release with the same tag name and the same ziti - # binary release version - if: github.repository_owner == 'openziti' - && ( - startsWith(github.ref_name, 'v') - || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'quickstartrelease')) + # this is only run on the official upstream repo when a PR is merged to the + # default branch "main" or a release tag is pushed or for the same + # conditions in a repo fork that overrides the container image repo to push + # to; merges to main trigger a quickstart release with a commit SHA suffix + # featuring the previous ziti binary release version, whereas release tag + # pushes trigger a quickstart release with the same tag name and the same + # ziti binary release version + if: (github.repository_owner == 'openziti' || vars.ZITI_QUICKSTART_IMAGE != '') && ( + startsWith(github.ref_name, 'v') || ( + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'quickstartrelease') + ) ) runs-on: ubuntu-latest env: @@ -27,7 +31,7 @@ jobs: # use github.ref, not github.head_ref, because this workflow should only run on merged PRs in the target/base # branch context, not the PR source branch GITHUB_REF: ${{ github.ref }} - # user github.sha, not github.pull_request.head.sha, because this workflow should only run on merged PRs in the + # use github.sha, not github.pull_request.head.sha, because this workflow should only run on merged PRs in the # target/base branch, not the PR source branch GITHUB_SHA: ${{ github.sha }} steps: @@ -89,32 +93,32 @@ jobs: if [[ "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then # Set output parameters for release tags - echo QUICKSTART_VERSION="${GITHUB_REF_NAME}" | tee -a $GITHUB_OUTPUT + QUICKSTART_VERSION="${GITHUB_REF_NAME}" elif [[ "${GITHUB_REF_NAME}" =~ ^main$ ]]; then # compute the latest release version to install in the quickstart image QUICKSTART_VERSION="$($(go env GOPATH)/bin/ziti-ci -q get-current-version ${ZITI_BASE_VERSION:+--base-version $ZITI_BASE_VERSION})" - - # drop the leading 'v', if any - QUICKSTART_VERSION=${QUICKSTART_VERSION#v} - validateSemver "${QUICKSTART_VERSION}" # Append short SHA to identify quickstart docker images shipped on merge to main QUICKSTART_VERSION="${QUICKSTART_VERSION}-$(git rev-parse --short ${GITHUB_SHA})" - echo QUICKSTART_VERSION="${QUICKSTART_VERSION}" | tee -a $GITHUB_OUTPUT - else echo "ERROR: Unexpected GITHUB_REF_NAME=${GITHUB_REF_NAME}" >&2 exit 1 fi - # configure the env var used by the quickstart's Dockerfile to download the correct version of ziti for the - # target architecture of each image build by trimming the hyphenated short sha suffix so that the preceding - # release version of the ziti executable is installed in the quickstart container image - ZITI_OVERRIDE_VERSION=${QUICKSTART_VERSION%-*} - echo ZITI_OVERRIDE_VERSION="${ZITI_OVERRIDE_VERSION}" | tee -a $GITHUB_OUTPUT + # configure the env var used by the quickstart's Dockerfile to + # download the correct version of ziti for the target architecture of + # each image build by trimming the hyphenated short sha suffix so that + # the preceding release version of the ziti executable is installed in + # the quickstart container image; ensure the QUICKSTART_VERSION + # (container image tag) does not have a leading 'v' and the + # ZITI_VERSION_OVERRIDE (GitHub tag ref) does have a leading 'v' + + QUICKSTART_VERSION="${QUICKSTART_VERSION#v}" + echo QUICKSTART_VERSION="${QUICKSTART_VERSION}" | tee -a $GITHUB_OUTPUT + echo ZITI_VERSION_OVERRIDE=v${QUICKSTART_VERSION%-*} | tee -a $GITHUB_OUTPUT # container image tag :latest is published on merge to default branch "main" and on release tags - name: Configure Quickstart Container @@ -146,6 +150,7 @@ jobs: python --version - name: Deploy the CloudFront Function for get.openziti.io + if: github.repository_owner == 'openziti' shell: bash run: python ./dist/cloudfront/get.openziti.io/deploy-cloudfront-function.py env: diff --git a/dist/dist-packages/linux/openziti-router/bootstrap.env b/dist/dist-packages/linux/openziti-router/bootstrap.env index f7cc61e89..9193b3373 100644 --- a/dist/dist-packages/linux/openziti-router/bootstrap.env +++ b/dist/dist-packages/linux/openziti-router/bootstrap.env @@ -1,5 +1,5 @@ # -# this is the ziti-controller.service bootstrapping inputs file where answers are recorded for generating a +# this is the ziti-router.service bootstrapping inputs file where answers are recorded for generating a # configuration # diff --git a/quickstart/docker/createLocalImage.sh b/quickstart/docker/createLocalImage.sh index 101e8db3c..468764290 100755 --- a/quickstart/docker/createLocalImage.sh +++ b/quickstart/docker/createLocalImage.sh @@ -32,10 +32,10 @@ fi # optionally, configure ZITI_VERSION for pushLatestDocker.sh if [[ -n "${ZITI_VERSION_OVERRIDE:-}" && -n "${ZITI_VERSION:-}" ]]; then - echo "WARN: both ZITI_VERSION and ZITI_VERSION_OVERRIDE are set, overriding $ZITI_VERSION with $ZITI_OVERRIDE_VERSION" >&2 + echo "WARN: both ZITI_VERSION and ZITI_VERSION_OVERRIDE are set, overriding $ZITI_VERSION with $ZITI_VERSION_OVERRIDE" >&2 export ZITI_VERSION="${ZITI_VERSION_OVERRIDE#v}" elif [[ -n "${ZITI_VERSION_OVERRIDE:-}" ]]; then - echo "INFO: ZITI_VERSION_OVERRIDE is set, setting ZITI_VERSION=${ZITI_OVERRIDE_VERSION#v}" + echo "INFO: ZITI_VERSION_OVERRIDE is set, setting ZITI_VERSION=${ZITI_VERSION_OVERRIDE#v}" export ZITI_VERSION="${ZITI_VERSION_OVERRIDE#v}" elif [[ -n "${ZITI_VERSION:-}" ]]; then echo "INFO: ZITI_VERSION is set, using ZITI_VERSION=${ZITI_VERSION#v}" diff --git a/quickstart/docker/image/ziti-cli-functions.sh b/quickstart/docker/image/ziti-cli-functions.sh index 8aecaac08..193deb1c2 100644 --- a/quickstart/docker/image/ziti-cli-functions.sh +++ b/quickstart/docker/image/ziti-cli-functions.sh @@ -12,6 +12,9 @@ ASCI_BLUE='\033[00;34m' ASCI_PURPLE='\033[00;35m' ZITIx_EXPRESS_COMPLETE="" +: "${GITHUB_OWNER:=openziti}" +: "${GITHUB_REPO:=ziti}" + function WHITE { echo "${ASCI_WHITE}${1-}${ASCI_RESTORE}" } @@ -245,7 +248,7 @@ function _check_env_variable() { _error=true fi else - echo -e " * $(RED "Unsupported shell, supply a PR or log an issue on https://github.com/openziti/ziti") " + echo -e " * $(RED "Unsupported shell, supply a PR or log an issue on https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}") " return 1 fi done @@ -737,7 +740,7 @@ function getZiti { fi # Get the download link - zitidl="https://github.com/openziti/ziti/releases/download/${ZITI_BINARIES_VERSION-}/${ZITI_BINARIES_FILE}" + zitidl="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${ZITI_BINARIES_VERSION-}/${ZITI_BINARIES_FILE}" echo -e 'Downloading '"$(BLUE "${zitidl}")"' to '"$(BLUE "${ziti_binaries_file_abspath}")" curl -Ls "${zitidl}" -o "${ziti_binaries_file_abspath}" @@ -1137,7 +1140,7 @@ function getLatestZitiVersion { _detect_architecture - ziti_latest=$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/openziti/ziti/releases/latest) + ziti_latest=$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases/latest) ZITI_BINARIES_FILE=$(printf "%s" "${ziti_latest}" | tr '\r\n' ' ' | jq -r '.assets[] | select(.name | startswith("'"ziti-${ZITI_OSTYPE}-${ZITI_ARCH}-"'")) | .name') ZITI_BINARIES_VERSION=$(printf "%s" "${ziti_latest}" | tr '\r\n' ' ' | jq -r '.tag_name') } @@ -1494,7 +1497,7 @@ function _verify_ziti_version_exists { _detect_architecture - ziticurl="$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/openziti/ziti/releases/tags/"${ZITI_VERSION_OVERRIDE}")" + ziticurl="$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases/tags/"${ZITI_VERSION_OVERRIDE}")" ZITI_BINARIES_FILE=$(echo "${ziticurl}" | tr '\r\n' ' ' | jq -r '.assets[] | select(.name | startswith("'"ziti-${ZITI_OSTYPE}-${ZITI_ARCH}-"'")) | .name') ZITI_BINARIES_VERSION=$(echo "${ziticurl}" | tr '\r\n' ' ' | jq -r '.tag_name') diff --git a/quickstart/docker/pushLatestDocker.sh b/quickstart/docker/pushLatestDocker.sh index 557fc26a5..1d60c40fd 100755 --- a/quickstart/docker/pushLatestDocker.sh +++ b/quickstart/docker/pushLatestDocker.sh @@ -1,16 +1,21 @@ #!/usr/bin/env bash -set -eo pipefail + +set -o errexit +set -o nounset +set -o pipefail +# set -o xtrace SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +: "${ZITI_QUICKSTART_IMAGE:=openziti/quickstart}" -if [ -z "${ZITI_VERSION}" ]; then +if [ -z "${ZITI_VERSION:-}" ]; then DOCKER_IMAGE_ROOT="$(realpath ${SCRIPT_DIR}/image)" v=$(source "${DOCKER_IMAGE_ROOT}/ziti-cli-functions.sh"; getLatestZitiVersion > /dev/null 2>&1; echo ${ZITI_BINARIES_VERSION}) ZITI_VERSION=$(echo "${v}" | sed -e 's/^v//') echo "ZITI_VERSION=${ZITI_VERSION}" fi -if [ -z "${ZITI_VERSION}" ]; then +if [ -z "${ZITI_VERSION:-}" ]; then echo "ZITI_VERSION was not set and auto-detection failed." exit 1 fi @@ -21,7 +26,7 @@ if [ -z "${IMAGE_TAG}" ]; then echo "image tag name was not provided, using default '${IMAGE_TAG}'" fi -if [ "local" == "${1}" ]; then +if [ "local" == "${1-}" ]; then echo "LOADING LOCALLY instead of pushing to dockerhub" _BUILDX_PLATFORM="" _BUILDX_ACTION="--load" @@ -36,6 +41,6 @@ docker buildx create \ eval docker buildx build "${_BUILDX_PLATFORM}" "${SCRIPT_DIR}/image" \ --build-arg ZITI_VERSION_OVERRIDE="v${ZITI_VERSION}" \ - --tag "openziti/quickstart:${ZITI_VERSION}" \ - --tag "openziti/quickstart:${IMAGE_TAG}" \ + --tag "${ZITI_QUICKSTART_IMAGE}:${ZITI_VERSION}" \ + --tag "${ZITI_QUICKSTART_IMAGE}:${IMAGE_TAG}" \ "${_BUILDX_ACTION}" diff --git a/quickstart/test/compose-test.zsh b/quickstart/test/compose-test.zsh index fdb98043d..39cc945f0 100755 --- a/quickstart/test/compose-test.zsh +++ b/quickstart/test/compose-test.zsh @@ -72,7 +72,7 @@ if [[ -n "${ZITI_QUICK_DIR:-}" ]]; then if [[ -x "${ZITI_QUICK_DIR:-}/docker/createLocalImage.sh" ]]; then ( cd "${ZITI_QUICK_DIR}/docker" - unset ZITI_VERSION ZITI_OVERRIDE_VERSION # always build the local source + unset ZITI_VERSION ZITI_VERSION_OVERRIDE # always build the local source ./createLocalImage.sh --build "${ZITI_QUICK_TAG}" ) else From 7d86540ce6312103e3516134d75498dd79e08519 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 23 Sep 2024 16:34:22 -0400 Subject: [PATCH 2/4] debug quickstart scripts --- .github/workflows/release-quickstart.yml | 2 ++ quickstart/docker/image/Dockerfile | 4 ++++ quickstart/docker/image/fetch-ziti-bins.sh | 10 +++++++--- quickstart/docker/image/ziti-cli-functions.sh | 11 ++++------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-quickstart.yml b/.github/workflows/release-quickstart.yml index 3d3a53970..9e30f659f 100644 --- a/.github/workflows/release-quickstart.yml +++ b/.github/workflows/release-quickstart.yml @@ -141,6 +141,8 @@ jobs: tags: ${{ steps.tagprep_qs.outputs.DOCKER_TAGS }} build-args: | ZITI_VERSION_OVERRIDE=${{ steps.get_version.outputs.ZITI_VERSION_OVERRIDE }} + GITHUB_OWNER=${GITHUB_OWNER} + GITHUB_REPO=${GITHUB_REPO} push: true - name: Configure Python diff --git a/quickstart/docker/image/Dockerfile b/quickstart/docker/image/Dockerfile index 5b1b63e8a..750d9ac76 100644 --- a/quickstart/docker/image/Dockerfile +++ b/quickstart/docker/image/Dockerfile @@ -3,6 +3,10 @@ FROM ubuntu:rolling AS fetch-ziti-bins # optional arg to specify which version to fetch when local "ziti-bin" directory is not present ARG ZITI_VERSION_OVERRIDE ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_OWNER=openziti +ARG GITHUB_REPO=ziti +ENV GITHUB_OWNER=${GITHUB_OWNER} +ENV GITHUB_REPO=${GITHUB_REPO} RUN apt-get update \ && apt-get --yes install \ diff --git a/quickstart/docker/image/fetch-ziti-bins.sh b/quickstart/docker/image/fetch-ziti-bins.sh index 0b20e3eec..5628354aa 100644 --- a/quickstart/docker/image/fetch-ziti-bins.sh +++ b/quickstart/docker/image/fetch-ziti-bins.sh @@ -1,13 +1,17 @@ #!/bin/bash +set -o errexit +set -o nounset +set -o pipefail +# set -o xtrace + # this script is executed during the docker build, after the build context has been copied to /docker.build.context -dest="${1}" +ZITI_BIN_DIR="${1}" if [ -d /docker.build.context/ziti-bin ]; then - mv /docker.build.context/ziti-bin/ "${dest}" + mv /docker.build.context/ziti-bin/ "${ZITI_BIN_DIR}" else source /docker.build.context/ziti-cli-functions.sh getZiti - mv "${ZITI_BIN_DIR}" "${dest}" fi diff --git a/quickstart/docker/image/ziti-cli-functions.sh b/quickstart/docker/image/ziti-cli-functions.sh index 193deb1c2..80d473744 100644 --- a/quickstart/docker/image/ziti-cli-functions.sh +++ b/quickstart/docker/image/ziti-cli-functions.sh @@ -650,7 +650,7 @@ function getZiti { getLatestZitiVersion # sets ZITI_BINARIES_FILE & ZITI_BINARIES_VERSION default_path="${ZITI_HOME}/ziti-bin/ziti-${ZITI_BINARIES_VERSION}" echo -en "The path for ziti binaries has not been set, use the default (${default_path})? (Y/n) " - read -r reply + read -r reply || true if [[ -z "${reply}" || ${reply} =~ [yY] ]]; then echo "INFO: using the default path ${default_path}" ZITI_BIN_DIR="${default_path}" @@ -670,17 +670,14 @@ function getZiti { return 1 fi else - _check_env_variable ZITI_BINARIES_FILE ZITI_BINARIES_VERSION - retVal=$? - if [[ "${retVal}" != 0 ]]; then - return 1 - fi - # Check if an error occurred while trying to pull desired version (happens with incorrect version or formatting issue) if ! _verify_ziti_version_exists; then echo -e " * $(RED "ERROR: The version of ziti requested (${ZITI_VERSION_OVERRIDE}) could not be found for OS (${ZITI_OSTYPE}) and architecture (${ZITI_ARCH}). Please check these details and try again. The version should follow the format \"vx.x.x\".") " return 1 fi + if ! _check_env_variable ZITI_BINARIES_FILE ZITI_BINARIES_VERSION; then + return 1 + fi fi # Where to store the ziti binaries zip From f26e00235b90b561dc23b72f99a6baedc759cb9a Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 23 Sep 2024 18:00:55 -0400 Subject: [PATCH 3/4] fix path to ziti binary in getZiti() function --- quickstart/docker/image/ziti-cli-functions.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/quickstart/docker/image/ziti-cli-functions.sh b/quickstart/docker/image/ziti-cli-functions.sh index 80d473744..0fa6738cd 100644 --- a/quickstart/docker/image/ziti-cli-functions.sh +++ b/quickstart/docker/image/ziti-cli-functions.sh @@ -686,7 +686,7 @@ function getZiti { if ! test -f "${ZITI_BIN_DIR}/ziti"; then # Make the directory echo -e "No existing binary found, creating the ZITI_BIN_DIR directory ($(BLUE "${ZITI_BIN_DIR}"))" - mkdir -p "${ZITI_BIN_DIR}" + mkdir -p "${ZITI_BIN_DIR}/ziti-extract" retVal=$? if [[ "${retVal}" != 0 ]]; then echo -e " * $(RED "ERROR: An error occurred generating the path (${ZITI_BIN_DIR})")" @@ -706,7 +706,7 @@ function getZiti { unset ZITI_BIN_DIR _set_ziti_bin_dir # Make the directory - mkdir -p "${ZITI_BIN_DIR}" + mkdir -p "${ZITI_BIN_DIR}/ziti-extract" retVal=$? if [[ "${retVal}" != 0 ]]; then echo -e " * $(RED "ERROR: An error occurred generating the path (${ZITI_BIN_DIR}")" @@ -742,7 +742,12 @@ function getZiti { curl -Ls "${zitidl}" -o "${ziti_binaries_file_abspath}" # Unzip the files - tar -xf "${ziti_binaries_file_abspath}" --directory "${ZITI_BIN_DIR}" + tar -xf "${ziti_binaries_file_abspath}" --directory "${ZITI_BIN_DIR}/ziti-extract" + if [ -d "${ZITI_BIN_DIR}/ziti-extract/ziti" ]; then + mv "${ZITI_BIN_DIR}/ziti-extract/ziti/ziti" "${ZITI_BIN_DIR}/ziti" + else + mv "${ZITI_BIN_DIR}/ziti-extract/ziti" "${ZITI_BIN_DIR}/ziti" + fi # Cleanup rm "${ziti_binaries_file_abspath}" # Remove zip From 25f9120db5de8212008d216464a1eb095e368697 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 23 Sep 2024 18:36:12 -0400 Subject: [PATCH 4/4] fix github owner/name assignments --- .github/workflows/release-quickstart.yml | 4 ++-- quickstart/docker/image/Dockerfile | 8 ++++---- quickstart/docker/image/ziti-cli-functions.sh | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-quickstart.yml b/.github/workflows/release-quickstart.yml index 9e30f659f..2bfdc6ef0 100644 --- a/.github/workflows/release-quickstart.yml +++ b/.github/workflows/release-quickstart.yml @@ -141,8 +141,8 @@ jobs: tags: ${{ steps.tagprep_qs.outputs.DOCKER_TAGS }} build-args: | ZITI_VERSION_OVERRIDE=${{ steps.get_version.outputs.ZITI_VERSION_OVERRIDE }} - GITHUB_OWNER=${GITHUB_OWNER} - GITHUB_REPO=${GITHUB_REPO} + GITHUB_REPO_OWNER=${{ github.repository_owner }} + GITHUB_REPO_NAME=${{ github.event.repository.name }} push: true - name: Configure Python diff --git a/quickstart/docker/image/Dockerfile b/quickstart/docker/image/Dockerfile index 750d9ac76..c6658a448 100644 --- a/quickstart/docker/image/Dockerfile +++ b/quickstart/docker/image/Dockerfile @@ -3,10 +3,10 @@ FROM ubuntu:rolling AS fetch-ziti-bins # optional arg to specify which version to fetch when local "ziti-bin" directory is not present ARG ZITI_VERSION_OVERRIDE ARG DEBIAN_FRONTEND=noninteractive -ARG GITHUB_OWNER=openziti -ARG GITHUB_REPO=ziti -ENV GITHUB_OWNER=${GITHUB_OWNER} -ENV GITHUB_REPO=${GITHUB_REPO} +ARG GITHUB_REPO_OWNER=openziti +ARG GITHUB_REPO_NAME=ziti +ENV GITHUB_REPO_OWNER=${GITHUB_REPO_OWNER} +ENV GITHUB_REPO_NAME=${GITHUB_REPO_NAME} RUN apt-get update \ && apt-get --yes install \ diff --git a/quickstart/docker/image/ziti-cli-functions.sh b/quickstart/docker/image/ziti-cli-functions.sh index 0fa6738cd..357b300f4 100644 --- a/quickstart/docker/image/ziti-cli-functions.sh +++ b/quickstart/docker/image/ziti-cli-functions.sh @@ -12,8 +12,8 @@ ASCI_BLUE='\033[00;34m' ASCI_PURPLE='\033[00;35m' ZITIx_EXPRESS_COMPLETE="" -: "${GITHUB_OWNER:=openziti}" -: "${GITHUB_REPO:=ziti}" +: "${GITHUB_REPO_OWNER:=openziti}" +: "${GITHUB_REPO_NAME:=ziti}" function WHITE { echo "${ASCI_WHITE}${1-}${ASCI_RESTORE}" @@ -248,7 +248,7 @@ function _check_env_variable() { _error=true fi else - echo -e " * $(RED "Unsupported shell, supply a PR or log an issue on https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}") " + echo -e " * $(RED "Unsupported shell, supply a PR or log an issue on https://github.com/${GITHUB_REPO_OWNER}/${GITHUB_REPO_NAME}") " return 1 fi done @@ -737,7 +737,7 @@ function getZiti { fi # Get the download link - zitidl="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${ZITI_BINARIES_VERSION-}/${ZITI_BINARIES_FILE}" + zitidl="https://github.com/${GITHUB_REPO_OWNER}/${GITHUB_REPO_NAME}/releases/download/${ZITI_BINARIES_VERSION-}/${ZITI_BINARIES_FILE}" echo -e 'Downloading '"$(BLUE "${zitidl}")"' to '"$(BLUE "${ziti_binaries_file_abspath}")" curl -Ls "${zitidl}" -o "${ziti_binaries_file_abspath}" @@ -1142,7 +1142,7 @@ function getLatestZitiVersion { _detect_architecture - ziti_latest=$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases/latest) + ziti_latest=$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_REPO_OWNER}/${GITHUB_REPO_NAME}/releases/latest) ZITI_BINARIES_FILE=$(printf "%s" "${ziti_latest}" | tr '\r\n' ' ' | jq -r '.assets[] | select(.name | startswith("'"ziti-${ZITI_OSTYPE}-${ZITI_ARCH}-"'")) | .name') ZITI_BINARIES_VERSION=$(printf "%s" "${ziti_latest}" | tr '\r\n' ' ' | jq -r '.tag_name') } @@ -1499,7 +1499,7 @@ function _verify_ziti_version_exists { _detect_architecture - ziticurl="$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases/tags/"${ZITI_VERSION_OVERRIDE}")" + ziticurl="$(curl -s https://${GITHUB_TOKEN:+${GITHUB_TOKEN}@}api.github.com/repos/${GITHUB_REPO_OWNER}/${GITHUB_REPO_NAME}/releases/tags/"${ZITI_VERSION_OVERRIDE}")" ZITI_BINARIES_FILE=$(echo "${ziticurl}" | tr '\r\n' ' ' | jq -r '.assets[] | select(.name | startswith("'"ziti-${ZITI_OSTYPE}-${ZITI_ARCH}-"'")) | .name') ZITI_BINARIES_VERSION=$(echo "${ziticurl}" | tr '\r\n' ' ' | jq -r '.tag_name')