From 5bb46d0f652bb8ec0cc088c596c6f02ae0405240 Mon Sep 17 00:00:00 2001 From: Kuba Martin Date: Thu, 17 Aug 2023 16:42:24 +0200 Subject: [PATCH] Fix GitHub actions (#5) * Change PKG_NAME Signed-off-by: Jakub Martin * Fix rpm and deb packaging. Signed-off-by: Jakub Martin * Fix e2e test step. Signed-off-by: Jakub Martin * Fix e2e test step. Signed-off-by: Jakub Martin * Fix e2e test step. Signed-off-by: Jakub Martin * Fix docker build. Signed-off-by: Jakub Martin * Fix exec tests. Signed-off-by: Jakub Martin * Fix e2e tests. Signed-off-by: Jakub Martin * Fix docker build. Signed-off-by: Jakub Martin --------- Signed-off-by: Jakub Martin --- .github/scripts/e2e_test_linux_darwin.sh | 6 +++--- .github/workflows/build-Dockerfile | 4 ++-- .github/workflows/build-terraform-oss.yml | 2 +- .github/workflows/build.yml | 16 ++++++++-------- internal/command/e2etest/make-archive.sh | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/scripts/e2e_test_linux_darwin.sh b/.github/scripts/e2e_test_linux_darwin.sh index 94cb27ceb1..7d0cb81ea4 100755 --- a/.github/scripts/e2e_test_linux_darwin.sh +++ b/.github/scripts/e2e_test_linux_darwin.sh @@ -8,11 +8,11 @@ if [[ $arch == 'arm' || $arch == 'arm64' ]] then export DIR=$(mktemp -d) unzip -d $DIR "${e2e_cache_path}/terraform-e2etest_${os}_${arch}.zip" - unzip -d $DIR "./terraform_${version}_${os}_${arch}.zip" + unzip -d $DIR "./opentf_${version}_${os}_${arch}.zip" sudo chmod +x $DIR/e2etest docker run --platform=linux/arm64 -v $DIR:/src -w /src arm64v8/alpine ./e2etest -test.v else unzip "${e2e_cache_path}/terraform-e2etest_${os}_${arch}.zip" - unzip "./terraform_${version}_${os}_${arch}.zip" + unzip "./opentf_${version}_${os}_${arch}.zip" TF_ACC=1 ./e2etest -test.v -fi \ No newline at end of file +fi diff --git a/.github/workflows/build-Dockerfile b/.github/workflows/build-Dockerfile index c0ea5b89d3..e4b4658512 100644 --- a/.github/workflows/build-Dockerfile +++ b/.github/workflows/build-Dockerfile @@ -36,6 +36,6 @@ RUN apk add --no-cache git openssh # directory before running "docker build", which we'll then copy into the # Docker image to make sure that we use an identical binary as all of the # other official release channels. -COPY ["dist/linux/${TARGETARCH}/terraform", "/bin/terraform"] +COPY ["dist/linux/${TARGETARCH}/opentf", "/bin/opentf"] -ENTRYPOINT ["/bin/terraform"] +ENTRYPOINT ["/bin/opentf"] diff --git a/.github/workflows/build-terraform-oss.yml b/.github/workflows/build-terraform-oss.yml index f869b3e881..5b485267bd 100644 --- a/.github/workflows/build-terraform-oss.yml +++ b/.github/workflows/build-terraform-oss.yml @@ -79,7 +79,7 @@ jobs: maintainer: "HashiCorp" homepage: "https://terraform.io/" license: "MPL-2.0" - binary: "dist/terraform" + binary: "dist/opentf" deb_depends: "git" rpm_depends: "git" - if: ${{ inputs.goos == 'linux' }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc69558b6e..0dd6422912 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+*' env: - PKG_NAME: "terraform" + PKG_NAME: "opentf" permissions: contents: read @@ -141,9 +141,9 @@ jobs: - name: Build Docker images uses: hashicorp/actions-docker-build@v1 with: - pkg_name: "terraform_${{env.version}}" + pkg_name: "opentf_${{env.version}}" version: ${{env.version}} - bin_name: terraform + bin_name: opentf target: default arch: ${{matrix.arch}} dockerfile: .github/workflows/build-Dockerfile @@ -256,13 +256,13 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 id: clipkg with: - name: terraform_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip + name: opentf_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip path: . - name: Extract packages if: ${{ matrix.goos == 'windows' }} run: | unzip "${{ needs.e2etest-build.outputs.e2e-cache-path }}/terraform-e2etest_${{ env.os }}_${{ env.arch }}.zip" - unzip "./terraform_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip" + unzip "./opentf_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip" - name: Set up QEMU uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0 if: ${{ contains(matrix.goarch, 'arm') }} @@ -305,7 +305,7 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 id: clipkg with: - name: terraform_${{ env.version }}_linux_amd64.zip + name: opentf_${{ env.version }}_linux_amd64.zip path: . - name: Checkout terraform-exec repo uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 @@ -315,7 +315,7 @@ jobs: - name: Run terraform-exec end-to-end tests run: | FULL_RELEASE_VERSION="${{ env.version }}" - unzip terraform_${FULL_RELEASE_VERSION}_linux_amd64.zip - export TFEXEC_E2ETEST_TERRAFORM_PATH="$(pwd)/terraform" + unzip opentf_${FULL_RELEASE_VERSION}_linux_amd64.zip + export TFEXEC_E2ETEST_TERRAFORM_PATH="$(pwd)/opentf" cd terraform-exec go test -race -timeout=30m -v ./tfexec/internal/e2etest diff --git a/internal/command/e2etest/make-archive.sh b/internal/command/e2etest/make-archive.sh index 248f251257..f737dfd2b9 100755 --- a/internal/command/e2etest/make-archive.sh +++ b/internal/command/e2etest/make-archive.sh @@ -34,7 +34,7 @@ GOEXE="$(go env GOEXE)" OUTDIR="build/${GOOS}_${GOARCH}" OUTFILE="terraform-e2etest_${GOOS}_${GOARCH}.zip" -LDFLAGS="-X github.com/placeholderplaceholderplaceholder/opentf/internal/command/e2etest.terraformBin=./terraform$GOEXE" +LDFLAGS="-X github.com/placeholderplaceholderplaceholder/opentf/internal/command/e2etest.terraformBin=./opentf$GOEXE" # Caller may pass in the environment variable GO_LDFLAGS with additional # flags we'll use when building. if [ -n "${GO_LDFLAGS+set}" ]; then