From f9cda684f9e870e8ebbf4a4df5e4e5205e3f9d39 Mon Sep 17 00:00:00 2001 From: ximon18 <3304436+ximon18@users.noreply.github.com> Date: Mon, 11 Nov 2019 11:44:00 +0100 Subject: [PATCH] GitHub Actions workflow tweaks. - Temporarily allow the E2E test to be triggered by an issue comment so that minor issues with migrating it from the rpki-deploy repo can be resolved without unnecessary commits just to trigger the build. - Debug print the current working directory to find out why the build was unable to find the Dockerfile. - Be explicit about the paths to use. --- .github/workflows/main.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13f9cf56..38b87c1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: E2E Test -on: [push, pull_request] +on: [push, pull_reques, issue_comment] jobs: krill_e2e_test: @@ -23,20 +23,23 @@ jobs: # to leverage an existing Cargo cache and thus speed up deployment. - name: Install modified Dockerfile into Krill checkout run: | - cp terraform/krill-e2e-test/lib/docker/krill/Dockerfile ${GITHUB_WORKSPACE}/../krill/Dockerfile - + cp ${GITHUB_WORKSPACE}/../repki-deploy/terraform/krill-e2e-test/lib/docker/krill/Dockerfile ${GITHUB_WORKSPACE}/../krill/Dockerfile + - name: Install Terraform uses: marocchino/setup-terraform@v1 with: version: "0.12.13" + - name: Debug print cwd + run: pwd + - name: Install Terraform plugins run: | mkdir -p $HOME/.terraform.d/plugins/ - cp terraform/plugins/terraform-provider-dockermachine $HOME/.terraform.d/plugins/ + cp ${GITHUB_WORKSPACE}/../repki-deploy/terraform/plugins/terraform-provider-dockermachine $HOME/.terraform.d/plugins/ - name: Decrypt SSH key - working-directory: terraform/krill-e2e-test + working-directory: ${GITHUB_WORKSPACE}/../repki-deploy/terraform/krill-e2e-test run: | ./decrypt-ssh-key.sh ls -la $HOME/secrets/ @@ -46,7 +49,7 @@ jobs: # Don't lock the state file, otherwise if the user cancels the build via the # GitHub Actions UI the terraform destroy cleanup step will fail. - name: Deploy - working-directory: terraform/krill-e2e-test/run_on_do + working-directory: ${GITHUB_WORKSPACE}/../repki-deploy/terraform/krill-e2e-test/run_on_do timeout-minutes: 30 run: | terraform init @@ -59,7 +62,7 @@ jobs: TF_VAR_size: s-8vcpu-32gb - name: Run tests - working-directory: terraform/krill-e2e-test/run_on_do + working-directory: ${GITHUB_WORKSPACE}/../repki-deploy/terraform/krill-e2e-test/run_on_do run: terraform apply -auto-approve -var "ssh_key_path=$HOME/secrets/ssh_key" -var "krill_build_path=${GITHUB_WORKSPACE}/../krill" env: # Don't embed env var references in env var definitions here, instead @@ -69,7 +72,7 @@ jobs: - name: Undeploy if: always() - working-directory: terraform/krill-e2e-test/run_on_do + working-directory: ${GITHUB_WORKSPACE}/../repki-deploy/terraform/krill-e2e-test/run_on_do run: terraform destroy -auto-approve -var "ssh_key_path=$HOME/secrets/ssh_key" -var "krill_build_path=${GITHUB_WORKSPACE}/../krill" env: # Don't embed env var references in env var definitions here, instead