Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sebastian/prod-2721-think-up-a-t…
Browse files Browse the repository at this point in the history
…est-strategy-for-plural-up' into sebastian/prod-2721-think-up-a-test-strategy-for-plural-up
  • Loading branch information
maciaszczykm committed Nov 27, 2024
2 parents 96dec7c + c617d47 commit faec50f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
VENOM_VAR_directory: /home/runner/testout/azure
VENOM_VAR_gitRepo: [email protected]:pluralsh/plural-cli-e2e.git
VENOM_VAR_gitRepoPrivateKeyPath: /home/runner/.ssh/id_rsa
E2E_GCP_SA_KEY_FILE: /home/runner/google_sa.json
# E2E_GCP_SA_KEY_FILE: /home/runner/google_sa.json
jobs:
plural-up-gcp:
name: plural up / GCP
Expand All @@ -41,12 +41,13 @@ jobs:
chmod 600 ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
eval "$(ssh-agent -s)"
ssh-add ${{ env.VENOM_VAR_gitRepoPrivateKeyPath }}
- name: Decode and save Google service account to a file
run: (base64 -d <<< ${{ secrets.E2E_GCP_SA_KEY }}) > ${{ env.E2E_GCP_SA_KEY_FILE }}
# - name: Decode and save Google service account to a file/env var
# run: (base64 -d <<< ${{ secrets.E2E_GCP_SA_KEY }}) > ${{ env.E2E_GCP_SA_KEY_FILE }}
- name: GCloud Auth
uses: google-github-actions/auth@v2
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ env.E2E_GCP_SA_KEY_FILE }}
project_id: 657418122889
workload_identity_provider: "projects/657418122889/locations/global/workloadIdentityPools/github/providers/github"
- name: Setup Go
uses: actions/[email protected]
with:
Expand All @@ -72,7 +73,7 @@ jobs:
VENOM_VAR_provider: gcp
VENOM_VAR_region: us-central1
VENOM_VAR_gcpEmail: ${{ secrets.E2E_GCP_EMAIL }}
VENOM_VAR_gcpSAKeyFile: ${{ secrets.E2E_GCP_SA_KEY_FILE }}
# VENOM_VAR_gcpSAKeyFile: ${{ secrets.E2E_GCP_SA_KEY_FILE }}
VENOM_VAR_gcpOrgID: ${{ secrets.E2E_GCP_ORG_ID }}
VENOM_VAR_gcpBillingID: ${{ secrets.E2E_GCP_BILLING_ID }}
VENOM_VAR_project: e2e-${{ env.TIMESTAMP }}
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ e2e: --ensure-venom
VENOM_VAR_azureSubscriptionId=${PLRL_CLI_E2E_AZURE_SUBSCRIPTION_ID} \
VENOM_VAR_azureTenantId=${PLRL_CLI_E2E_AZURE_TENANT_ID} \
VENOM_VAR_azureStorageAccount=${PLRL_CLI_E2E_AZURE_STORAGE_ACCOUNT}${TIMESTAMP} \
VENOM_VAR_gcpSAKeyFile=${PLRL_CLI_E2E_GCLOUD_KEY_FILE} \
VENOM_VAR_gcpEmail=${PLRL_CLI_E2E_GCLOUD_EMAIL} \
VENOM_VAR_gcpOrgID=${PLRL_CLI_E2E_GCLOUD_ORG_ID} \
VENOM_VAR_gcpBillingID=${PLRL_CLI_E2E_GCLOUD_BILLING_ID} \
Expand Down
Binary file removed az-test
Binary file not shown.
1 change: 0 additions & 1 deletion pkg/up/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func (tf *terraformCmd) outputs() (map[string]Output, error) {

func (tf *terraformCmd) run() (err error) {
for tf.retries >= 0 {
fmt.Println(tf.dir, tf.cmd, tf.args)
args := append([]string{tf.cmd}, tf.args...)
cmd := exec.Command("terraform", args...)
cmd.Dir = tf.dir
Expand Down
2 changes: 0 additions & 2 deletions test/plural/lib/gcloud-setup.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
executor: gcloud-setup
input:
email: ''
saKeyFile: ''
orgID: ''
project: ''
billingID: ''

steps:
- script: |
gcloud auth activate-service-account {{ .input.email }} --key-file={{ .input.saKeyFile }} ;\
gcloud projects describe {{ .input.project }} ;\
if [ $? -eq 1 ]; then \
echo "Project does not exist. Creating..." ;\
Expand Down
4 changes: 1 addition & 3 deletions test/plural/lib/gcloud-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ input:
project: ''

steps:
- script: |
gcloud auth activate-service-account {{ .input.email }} --key-file={{ .input.saKeyFile }} ;\
gcloud -q projects delete {{ .input.project }}
- script: gcloud -q projects delete {{ .input.project }}
retry: 3
retry_if:
- result.code ShouldNotEqual 0
Expand Down
4 changes: 0 additions & 4 deletions test/plural/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ vars:
### GCP variables
# Google Service Account email
gcpEmail: ''
# Google Service Account key file
gcpSAKeyFile: ''
# Google organization ID
gcpOrgID: ''
# Google billing account ID
Expand Down Expand Up @@ -94,7 +92,6 @@ testcases:
steps:
- type: gcloud-setup
email: {{ .gcpEmail }}
saKeyFile: {{ .gcpSAKeyFile }}
orgID: {{ .gcpOrgID }}
billingID: {{ .gcpBillingID }}
project: {{ .project }}
Expand All @@ -120,7 +117,6 @@ testcases:
steps:
- type: gcloud-teardown
email: {{ .gcpEmail }}
saKeyFile: {{ .gcpSAKeyFile }}
project: {{ .project }}

- name: Git teardown
Expand Down

0 comments on commit faec50f

Please sign in to comment.