Skip to content

Commit

Permalink
fixup! init
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Dec 19, 2023
1 parent 4593beb commit 4124d7c
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/e2e-test-provider-example.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: e2e test Terraform provider example

on:
push:
branches:
- feat/ci/test-provider-example
workflow_dispatch:
inputs:
ref:
Expand All @@ -23,8 +20,8 @@ on:
image:
description: "OS Image version used in the cluster's VMs, as specified in the Constellation config. If not set, the latest nightly image from main is used."
type: string
cliVersion:
description: "Constellation CLI version to use. Empty value means build from source."
providerVersion:
description: "Constellation Terraform provider version to use. Empty value means build from source."
type: string
workflow_call:
inputs:
Expand All @@ -41,12 +38,12 @@ on:
image:
description: "OS Image version used in the cluster's VMs, as specified in the Constellation config. If not set, the latest nightly image from main is used."
type: string
cliVersion:
description: "Constellation CLI version to use. Empty value means build from source."
providerVersion:
description: "Constellation Terraform provider version to use. Empty value means build from source."
type: string

jobs:
tf-module-test:
provider-example-test:
runs-on: ubuntu-22.04
permissions:
id-token: write
Expand All @@ -71,7 +68,7 @@ jobs:
- name: Upload Terraform module
uses: ./.github/actions/upload_terraform_module
with:
version: ${{ inputs.cliVersion }}
version: ${{ inputs.providerVersion }}

- name: Download Terraform module
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -110,7 +107,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup bazel
if: inputs.cliVersion == ''
if: inputs.providerVersion == ''
uses: ./.github/actions/setup_bazel_nix
with:
useCache: "true"
Expand All @@ -136,13 +133,14 @@ jobs:
terraform_provider_dir="${HOME}/.terraform.d/plugins/registry.terraform.io/edgelesssys/constellation/${build_version#v}/linux_amd64/"
mkdir -p "${terraform_provider_dir}"
mv build/terraform-provider-constellation "${terraform_provider_dir}/terraform-provider-constellation_${build_version}"
echo "BUILD_VERSION=${build_version}"
echo "build_version=${build_version}" | tee -a "$GITHUB_OUTPUT"
#- name: Download Provider
# if: inputs.cliVersion != ''
# if: inputs.providerVersion != ''
# shell: bash
# run: |
# curl -fsSL -o constellation https://github.com/edgelesssys/constellation/releases/download/${{ inputs.cliVersion }}/constellation-linux-amd64
# curl -fsSL -o constellation https://github.com/edgelesssys/constellation/releases/download/${{ inputs.providerVersion }}/constellation-linux-amd64
# chmod u+x constellation
# ./constellation version
# sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts'
Expand All @@ -168,7 +166,14 @@ jobs:
with:
service_account: "[email protected]"

- name: Create GCP TF overrides
- name: Get GCP region
if: inputs.cloudProvider == 'gcp'
id: get_gcp_region
shell: bash
run: |
echo "region=$(echo ${{ inputs.regionZone || 'europe-west3' }} | rev | cut -c 3- | rev)" | tee -a "$GITHUB_OUTPUT"
- name: Create GCP Terraform overrides
if: inputs.cloudProvider == 'gcp'
working-directory: ${{ github.workspace }}
shell: bash
Expand All @@ -180,14 +185,16 @@ jobs:
required_providers {
constellation = {
source = "edgelesssys/constellation"
version = "${{ steps.install_tf_provider.outputs.BUILD_VERSION }}" # TODO support released versions
version = "${{ steps.install_tf_provider.outputs.build_version }}" # TODO support released versions
}
}
}
locals {
name = "${{ steps.create-prefix.outputs.prefix }}"
version = "${{ steps.find-latest-image.outputs.image }}"
project_id = "constellation-e2e"
region = "${{ steps.get_gcp_region.outputs.region }}"
zone = "${{ inputs.regionZone || 'europe-west3-b' }}"
}
module "gcp_iam" {
Expand Down

0 comments on commit 4124d7c

Please sign in to comment.