From b5e35527769384b3a7f9a284bfaa982008e415fc Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Mon, 26 Feb 2024 18:11:01 +0000 Subject: [PATCH] Fix variable name Signed-off-by: Gabriel Adrian Samfira --- .github/workflows/integration-tests.yml | 10 +++------- test/integration/config/config.toml | 2 +- test/integration/scripts/setup-garm.sh | 20 +++++++++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0e70db70..19264582 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -22,9 +22,6 @@ jobs: - name: Install dependencies run: sudo apt-get -qq update && sudo apt-get -qq install -y apg coreutils make - - name: Build GARM - run: make build - - name: Set up ngrok id: ngrok uses: gabriel-samfira/ngrok-tunnel-action@v1.1 @@ -68,7 +65,7 @@ jobs: if: always() run: | sudo systemctl status garm@runner || true - sudo journalctl --no-pager 2>&1 | tee /artifacts-logs/system.log + sudo journalctl --no-pager 2>&1 > /artifacts-logs/system.log - name: Upload GARM and e2e logs if: always() @@ -83,9 +80,8 @@ jobs: set -o pipefail set -o errexit - sudo systemctl stop garm - - go run ./test/integration/gh_cleanup/main.go + sudo systemctl stop garm@runner || true + go run ./test/integration/gh_cleanup/main.go || true env: GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }} ORG_NAME: gsamfira diff --git a/test/integration/config/config.toml b/test/integration/config/config.toml index d937e8ac..3d5fbc13 100644 --- a/test/integration/config/config.toml +++ b/test/integration/config/config.toml @@ -47,4 +47,4 @@ oauth2_token = "${GH_TOKEN}" [[github]] name = "${CREDENTIALS_NAME}-clone" description = "GARM GitHub OAuth token - clone" -oauth2_token = "${GH_OAUTH_TOKEN}" +oauth2_token = "${GH_TOKEN}" diff --git a/test/integration/scripts/setup-garm.sh b/test/integration/scripts/setup-garm.sh index 7a3f68f4..e574b542 100755 --- a/test/integration/scripts/setup-garm.sh +++ b/test/integration/scripts/setup-garm.sh @@ -4,23 +4,29 @@ set -o errexit DIR="$(dirname $0)" BINARIES_DIR="$PWD/bin" CONTRIB_DIR="$PWD/contrib" -CONFIG_DIR="$PWD/test/integration/config" -CONFIG_DIR_PROV="$PWD/test/integration/provider" -GARM_CONFIG_DIR=${GARM_CONFIG_DIR:-$(mktemp -d)} -PROVIDER_BIN_DIR="$GARM_CONFIG_DIR/providers.d/lxd" -IS_GH_WORKFLOW=${IS_GH_WORKFLOW:-"true"} +export CONFIG_DIR="$PWD/test/integration/config" +export CONFIG_DIR_PROV="$PWD/test/integration/provider" +export GARM_CONFIG_DIR=${GARM_CONFIG_DIR:-$(mktemp -d)} +export PROVIDER_BIN_DIR="$GARM_CONFIG_DIR/providers.d/lxd" +export IS_GH_WORKFLOW=${IS_GH_WORKFLOW:-"true"} export LXD_PROVIDER_LOCATION=${LXD_PROVIDER_LOCATION:-""} -export RUN_USER=${RUN_USER:-$(whoami)} +export RUN_USER=${RUN_USER:-$USER} export GARM_PORT=${GARM_PORT:-"9997"} export GARM_SERVICE_NAME=${GARM_SERVICE_NAME:-"garm"} export GARM_CONFIG_FILE=${GARM_CONFIG_FILE:-"${GARM_CONFIG_DIR}/config.toml"} +if [ -f "$GITHUB_ENV" ];then + echo "export GARM_CONFIG_DIR=${GARM_CONFIG_DIR}" >> $GITHUB_ENV + echo "export GARM_SERVICE_NAME=${GARM_SERVICE_NAME}" >> $GITHUB_ENV +fi + if [[ ! -f $BINARIES_DIR/garm ]] || [[ ! -f $BINARIES_DIR/garm-cli ]]; then echo "ERROR: Please build GARM binaries first" exit 1 fi -if [[ -z $GH_OAUTH_TOKEN ]]; then echo "ERROR: The env variable GH_OAUTH_TOKEN is not set"; exit 1; fi + +if [[ -z $GH_TOKEN ]]; then echo "ERROR: The env variable GH_TOKEN is not set"; exit 1; fi if [[ -z $CREDENTIALS_NAME ]]; then echo "ERROR: The env variable CREDENTIALS_NAME is not set"; exit 1; fi if [[ -z $GARM_BASE_URL ]]; then echo "ERROR: The env variable GARM_BASE_URL is not set"; exit 1; fi