From 0fa020d4cb673be344842eb37131969f1d3e022d Mon Sep 17 00:00:00 2001 From: Benoit Ranque Date: Tue, 19 Mar 2024 22:45:16 -0400 Subject: [PATCH] inline short CI scripts --- .github/workflows/deploy-stage.yaml | 21 +++++++++++++++++++-- ci/scripts/generate-connector-definition.sh | 8 -------- ci/scripts/generate-manifest.sh | 13 ------------- 3 files changed, 19 insertions(+), 23 deletions(-) delete mode 100755 ci/scripts/generate-connector-definition.sh delete mode 100755 ci/scripts/generate-manifest.sh diff --git a/.github/workflows/deploy-stage.yaml b/.github/workflows/deploy-stage.yaml index 9ffb164..98095a4 100644 --- a/.github/workflows/deploy-stage.yaml +++ b/.github/workflows/deploy-stage.yaml @@ -154,8 +154,19 @@ jobs: - name: generate CLI manifest run: | + set -evo pipefail + ROOT="$(pwd)" + export CLI_VERSION="$GITHUB_REF_NAME" - ./ci/scripts/generate-manifest.sh + + export LINUX_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-unknown-linux-musl | cut -f1 -d' ') + export MACOS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-apple-darwin | cut -f1 -d' ') + export WINDOWS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-pc-windows-msvc.exe | cut -f1 -d' ') + export LINUX_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-aarch64-unknown-linux-musl | cut -f1 -d' ') + export MACOS_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-aarch64-apple-darwin | cut -f1 -d' ') + + mkdir -p "${ROOT}/release/" + cat "${ROOT}/ci/templates/manifest.yaml" | envsubst > "${ROOT}/release/manifest.yaml" - uses: actions/upload-artifact@v4 with: @@ -165,9 +176,15 @@ jobs: - name: Build connector definition run: | + set -evo pipefail + ROOT="$(pwd)" + export DOCKER_IMAGE="ghcr.io/hasura/ndc-clickhouse:$GITHUB_REF_NAME" export CLI_VERSION=$GITHUB_REF_NAME - ./ci/scripts/generate-connector-definition.sh + + mkdir -p "${ROOT}/release/connector-definition/.hasura-connector/" + cat "${ROOT}/ci/templates/connector-metadata.yaml" | envsubst > "${ROOT}/release/connector-definition/.hasura-connector/connector-metadata.yaml" + tar -czvf "${ROOT}/release/artifacts/connector-definition.tgz" "${ROOT}/release/connector-definition/" - uses: actions/upload-artifact@v4 with: diff --git a/ci/scripts/generate-connector-definition.sh b/ci/scripts/generate-connector-definition.sh deleted file mode 100755 index 5226859..0000000 --- a/ci/scripts/generate-connector-definition.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -evo pipefail -ROOT="$(pwd)" - -mkdir -p "${ROOT}/release/connector-definition/.hasura-connector/" -cat "${ROOT}/ci/templates/connector-metadata.yaml" | envsubst > "${ROOT}/release/connector-definition/.hasura-connector/connector-metadata.yaml" -tar -czvf "${ROOT}/release/artifacts/connector-definition.tgz" "${ROOT}/release/connector-definition/" \ No newline at end of file diff --git a/ci/scripts/generate-manifest.sh b/ci/scripts/generate-manifest.sh deleted file mode 100755 index 1b6b03c..0000000 --- a/ci/scripts/generate-manifest.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -evo pipefail -ROOT="$(pwd)" - -export LINUX_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-unknown-linux-musl | cut -f1 -d' ') -export MACOS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-apple-darwin | cut -f1 -d' ') -export WINDOWS_AMD64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-x86_64-pc-windows-msvc.exe | cut -f1 -d' ') -export LINUX_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-aarch64-unknown-linux-musl | cut -f1 -d' ') -export MACOS_ARM64_SHA256=$(sha256sum ${ROOT}/release/artifacts/ndc-clickhouse-cli-aarch64-apple-darwin | cut -f1 -d' ') - -mkdir -p "${ROOT}/release/" -cat "${ROOT}/ci/templates/manifest.yaml" | envsubst > "${ROOT}/release/manifest.yaml"