From 938afe0d032755ed24cdca7468d959ba7970e0ae Mon Sep 17 00:00:00 2001 From: dylanhitt Date: Mon, 15 Apr 2024 18:07:43 -0400 Subject: [PATCH] build: fix build terraform/opentofu build pathing --- Dockerfile | 8 ++++---- scripts/download-release.sh | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 090397c82d..85ee5ef720 100644 --- a/Dockerfile +++ b/Dockerfile @@ -147,8 +147,8 @@ RUN addgroup atlantis && \ # copy atlantis binary COPY --from=builder /app/atlantis /usr/local/bin/atlantis # copy terraform binaries -COPY --from=deps /usr/local/bin/terraform* /usr/local/bin/ -COPY --from=deps /usr/local/bin/tofu* /usr/local/bin/ +COPY --from=deps /usr/local/bin/terraform/terraform* /usr/local/bin/ +COPY --from=deps /usr/local/bin/tofu/tofu* /usr/local/bin/ # copy dependencies COPY --from=deps /usr/local/bin/conftest /usr/local/bin/conftest COPY --from=deps /usr/bin/git-lfs /usr/bin/git-lfs @@ -187,8 +187,8 @@ RUN useradd --create-home --user-group --shell /bin/bash atlantis && \ # copy atlantis binary COPY --from=builder /app/atlantis /usr/local/bin/atlantis # copy terraform binaries -COPY --from=deps /usr/local/bin/terraform* /usr/local/bin/ -COPY --from=deps /usr/local/bin/tofu* /usr/local/bin/ +COPY --from=deps /usr/local/bin/terraform/terraform* /usr/local/bin/ +COPY --from=deps /usr/local/bin/tofu/tofu* /usr/local/bin/ # copy dependencies COPY --from=deps /usr/local/bin/conftest /usr/local/bin/conftest COPY --from=deps /usr/bin/git-lfs /usr/bin/git-lfs diff --git a/scripts/download-release.sh b/scripts/download-release.sh index 9b3ea574d3..8b661bf1a1 100755 --- a/scripts/download-release.sh +++ b/scripts/download-release.sh @@ -1,8 +1,8 @@ #!/bin/sh COMMAND_NAME=${1:-terraform} TARGETPLATFORM=${2:-"linux/amd64"} -DEFAULT_VERSION=${3:-"1.6.2"} -AVAILABLE_VERSIONS=${4:-"1.6.2"} +DEFAULT_VERSION=${3:-"1.8.0"} +AVAILABLE_VERSIONS=${4:-"1.8.0"} case "${TARGETPLATFORM}" in "linux/amd64") ARCH=amd64 ;; "linux/arm64") ARCH=arm64 ;; @@ -13,11 +13,11 @@ for VERSION in ${AVAILABLE_VERSIONS}; do case "${COMMAND_NAME}" in "terraform") DOWNLOAD_URL_FORMAT=$(printf 'https://releases.hashicorp.com/terraform/%s/%s_%s' "$VERSION" "$COMMAND_NAME" "$VERSION") - COMMAND_DIR=/usr/local/bin/tf + COMMAND_DIR=/usr/local/bin/terraform ;; "tofu") DOWNLOAD_URL_FORMAT=$(printf 'https://github.com/opentofu/opentofu/releases/download/v%s/%s_%s' "$VERSION" "$COMMAND_NAME" "$VERSION") - COMMAND_DIR=/usr/local/bin/opentofu + COMMAND_DIR=/usr/local/bin/tofu ;; *) echo "ERROR: 'COMMAND_NAME' value unexpected: ${COMMAND_NAME}"; exit 1 ;; esac @@ -26,8 +26,8 @@ for VERSION in ${AVAILABLE_VERSIONS}; do sed -n "/${COMMAND_NAME}_${VERSION}_linux_${ARCH}.zip/p" "${COMMAND_NAME}_${VERSION}_SHA256SUMS" | sha256sum -c mkdir -p "${COMMAND_DIR}/${VERSION}" unzip "${COMMAND_NAME}_${VERSION}_linux_${ARCH}.zip" -d "${COMMAND_DIR}/${VERSION}" - ln -s "${COMMAND_DIR}/${VERSION}/${COMMAND_NAME}" "${COMMAND_NAME}${VERSION}" + ln -s "${COMMAND_DIR}/${VERSION}/${COMMAND_NAME}" "${COMMAND_DIR}/${COMMAND_NAME}${VERSION}" rm "${COMMAND_NAME}_${VERSION}_linux_${ARCH}.zip" rm "${COMMAND_NAME}_${VERSION}_SHA256SUMS" done -ln -s "${COMMAND_DIR}/${DEFAULT_VERSION}/${COMMAND_NAME}" "${COMMAND_NAME}" +ln -s "${COMMAND_DIR}/${DEFAULT_VERSION}/${COMMAND_NAME}" "${COMMAND_DIR}/${COMMAND_NAME}"