This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
105 lines (102 loc) · 4.76 KB
/
ci-e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI-E2E
on:
push:
branches:
- main
- "release-*"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- '**.adoc'
- '**.md'
- 'samples/**'
- 'LICENSE'
pull_request_target:
branches:
- main
- "release-*"
paths-ignore:
- '**.adoc'
- '**.md'
- 'samples/**'
- 'LICENSE'
workflow_dispatch:
jobs:
e2e_test_suite:
name: E2E Test Suite
runs-on: ubuntu-latest
# see https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
# for info on author association
environment:
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.author_association != 'OWNER' &&
github.event.pull_request.author_association != 'MEMBER' &&
github.event.pull_request.author_association != 'COLLABORATOR' &&
github.event.pull_request.author_association != 'CONTRIBUTOR' &&
'e2e-external' || 'e2e-internal' }}
steps:
- run: cat $GITHUB_EVENT_PATH
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Create controller-config.env
run: |
echo "AWS_DNS_PUBLIC_ZONE_ID=${{ secrets.E2E_AWS_DNS_PUBLIC_ZONE_ID }}" >> controller-config.env
echo "ZONE_ROOT_DOMAIN=${{ secrets.E2E_AWS_DNS_PUBLIC_ZONE_NAME }}" >> controller-config.env
echo "ZONE_NAME=${{ secrets.E2E_GCP_ZONE_NAME }}" >> controller-config.env
echo "ZONE_DNS_NAME=${{ secrets.E2E_GCP_ZONE_DNS_NAME }}" >> controller-config.env
- name: Create aws-credentials.env
run: |
echo "AWS_ACCESS_KEY_ID=${{ secrets.E2E_AWS_ACCESS_KEY_ID }}" >> aws-credentials.env
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}" >> aws-credentials.env
echo "AWS_REGION=${{ env.AWS_REGION }}" >> aws-credentials.env
- name: Create gcp-credentials.env
run: |
secret="${{ secrets.E2E_GOOGLE }}"
decoded=$(echo "$secret" | base64 --decode )
echo "GOOGLE=$decoded" >> gcp-credentials.env
echo "PROJECT_ID=${{ secrets.E2E_PROJECT_ID }}" >> gcp-credentials.env
- name: Setup environment
run: |
export OCM_SINGLE=1
make local-setup
- name: Deploy
run: |
make docker-build-gateway-controller kind-load-gateway-controller deploy-gateway-controller
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system get deployments/mgc-controller-manager -o yaml | yq .spec.template.spec.containers[0].image
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-controller-manager
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-controller-manager -n multicluster-gateway-controller-system
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-aws -o yaml
kubectl --context kind-mgc-control-plane -n multi-cluster-gateways wait --timeout=60s --for=condition=Ready managedzone/mgc-dev-mz-aws
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-gcp -o yaml
kubectl --context kind-mgc-control-plane -n multi-cluster-gateways wait --timeout=60s --for=condition=Ready managedzone/mgc-dev-mz-gcp
- name: Run suite AWS
run: |
export OCM_SINGLE=1
export TEST_HUB_NAMESPACE=multi-cluster-gateways
export TEST_HUB_KUBE_CONTEXT=kind-mgc-control-plane
export TEST_DNS_PROVIDER_SECRET_NAME=mgc-aws-credentials
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.hcpapps.net
export TEST_DNS_ZONE_ID=Z086929132US3PB46EOLR
export TEST_MANAGED_ZONE=${{ secrets.E2E_AWS_DNS_PUBLIC_ZONE_NAME }}
export TEST_MANAGED_ZONE_NAME=mgc-dev-mz-aws
make test-e2e
- name: Run suite GCP
run: |
export OCM_SINGLE=1
export TEST_HUB_NAMESPACE=multi-cluster-gateways
export TEST_HUB_KUBE_CONTEXT=kind-mgc-control-plane
export TEST_DNS_PROVIDER_SECRET_NAME=mgc-gcp-credentials
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.google.hcpapps.net
export TEST_DNS_ZONE_ID=e2e-google-hcpapps-net
export TEST_MANAGED_ZONE=${{ secrets.E2E_GCP_ZONE_DNS_NAME }}
export TEST_MANAGED_ZONE_NAME=mgc-dev-mz-gcp
make test-e2e
- name: Dump Gateway Controller logs
if: ${{ failure() }}
run: |
kubectl get deployments -A
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-controller-manager -n multicluster-gateway-controller-system