Skip to content

Commit

Permalink
add aws workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz committed Nov 29, 2024
1 parent 061f24b commit dd35b73
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 24 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ e2e: --ensure-venom
VENOM_VAR_azureStorageAccount=${PLRL_CLI_E2E_AZURE_STORAGE_ACCOUNT}${TIMESTAMP} \
VENOM_VAR_gcpOrgID=${PLRL_CLI_E2E_GCLOUD_ORG_ID} \
VENOM_VAR_gcpBillingID=${PLRL_CLI_E2E_GCLOUD_BILLING_ID} \
VENOM_VAR_awsZoneA=${PLRL_CLI_E2E_AWS_ZONE_A} \
VENOM_VAR_awsZoneB=${PLRL_CLI_E2E_AWS_ZONE_B} \
VENOM_VAR_awsZoneC=${PLRL_CLI_E2E_AWS_ZONE_C} \
VENOM_VAR_projectAWS=${PLRL_CLI_E2E_PROJECT} \
PLURAL_LOGIN_AFFIRM_CURRENT_USER=true \
PLURAL_UP_AFFIRM_DEPLOY=true \
PLURAL_CD_USE_EXISTING_CREDENTIALS=true \
Expand Down
10 changes: 5 additions & 5 deletions test/plural/lib/cluster-services.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
executor: cluster-services

steps:
- script: plural cd services describe @mgmt/console -o jsonpath='{.status}'
retry: 3
delay: 50
assertions:
- result.systemout ShouldEqual HEALTHY
# - script: plural cd services describe @mgmt/console -o jsonpath='{.status}'
# retry: 3
# delay: 50
# assertions:
# - result.systemout ShouldEqual HEALTHY

- script: plural cd services describe @mgmt/deploy-operator -o jsonpath='{.status}'
retry: 3
Expand Down
5 changes: 4 additions & 1 deletion test/plural/lib/cluster-setup.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
executor: cluster-setup
input:
name: ''
directory: ''

steps:
- script: plural ops cluster
- script: |
cd {{ .input.directory }} ;\
plural ops cluster
assertions:
- result.code ShouldEqual 0
- script: |
Expand Down
34 changes: 34 additions & 0 deletions test/plural/lib/workspace-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ input:
azureSubscriptionId: ''
azureTenantId: ''
azureStorageAccount: ''

# AWS variables
awsZoneA: ''
awsZoneB: ''
awsZoneC: ''
projectAWS: ''

steps:
- script: |
cat << EOF > {{ .input.directory }}/workspace.yaml
Expand All @@ -37,3 +44,30 @@ steps:
TenantId: {{ .input.azureTenantId }}
assertions:
- result.code ShouldEqual 0
- skip:
- provider ShouldEqual aws
script: |
cat << EOF > {{ .input.directory }}/workspace.yaml
apiVersion: plural.sh/v1alpha1
kind: ProjectManifest
metadata:
name: {{ .input.name }}
spec:
cluster: {{ .input.name }}
bucket: {{ .input.name }}-tf-state
project: {{ .input.projectAWS }}
provider: {{ .input.provider }}
region: {{ .input.region }}
owner:
email: {{ .input.email }}
network:
subdomain: {{ .input.name }}.onplural.sh
pluraldns: true
availabilityzones:
- {{ .input.awsZoneA }}
- {{ .input.awsZoneB }}
- {{ .input.awsZoneC }}
bucketPrefix: {{ .input.name }}
context: {}
assertions:
- result.code ShouldEqual 0
47 changes: 29 additions & 18 deletions test/plural/up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ vars:
# Google billing account ID
gcpBillingID: ''

# AWS variables
awsZoneA: ''
awsZoneB: ''
awsZoneC: ''
projectAWS: ''

#secrets:
# - pluralKey
# - token
Expand Down Expand Up @@ -69,6 +75,10 @@ testcases:
azureSubscriptionId: {{ .azureSubscriptionId }}
azureTenantId: {{ .azureTenantId }}
azureStorageAccount: {{ .azureStorageAccount }}
awsZoneA: {{ .awsZoneA }}
awsZoneB: {{ .awsZoneB }}
awsZoneC: {{ .awsZoneC }}
projectAWS: {{ .projectAWS }}

- name: Setup context file
steps:
Expand Down Expand Up @@ -99,28 +109,29 @@ testcases:
plural up --commit "Plural up e2e cluster"
retry: 3
delay: 5
- name: Azure kubeconfig
skip:
- provider ShouldEqual azure
steps:
- type: azure-kubeconfig
name: {{ .username }}
project: {{ .project }}

- name: Google Cloud kubeconfig
skip:
- provider ShouldEqual gcp
steps:
- type: gcloud-kubeconfig
name: {{ .username }}
project: {{ .project }}
region: {{ .region }}

#
# - name: Azure kubeconfig
# skip:
# - provider ShouldEqual azure
# steps:
# - type: azure-kubeconfig
# name: {{ .username }}
# project: {{ .project }}
#
# - name: Google Cloud kubeconfig
# skip:
# - provider ShouldEqual gcp
# steps:
# - type: gcloud-kubeconfig
# name: {{ .username }}
# project: {{ .project }}
# region: {{ .region }}
#
- name: Test cluster
steps:
- type: cluster-setup
name: {{ .username }}
directory: {{ .directory }}
- type: cluster-services

- name: Azure teardown
Expand Down

0 comments on commit dd35b73

Please sign in to comment.