|
1 | 1 | GITHUB_RUN_NUMBER ?= 0 |
2 | | -FIXTURE_BASE_BRANCH := e2e-test/$(GITHUB_RUN_NUMBER)/main |
3 | | -FIXTURE_BRANCH_PREFIX := e2e-test/$(GITHUB_RUN_NUMBER) |
| 2 | +FIXTURE_BRANCH := e2e-test/$(GITHUB_RUN_NUMBER)/main |
4 | 3 |
|
5 | 4 | all: |
6 | 5 |
|
7 | | -push-base-branch: |
| 6 | +setup-fixture-branch: |
8 | 7 | git config user.name 'github-actions[bot]' |
9 | 8 | git config user.email '41898282+github-actions[bot]@users.noreply.github.com' |
10 | | - git checkout -B "$(FIXTURE_BASE_BRANCH)" |
| 9 | + git checkout -B "$(FIXTURE_BRANCH)" |
11 | 10 | git add . |
12 | | - git commit -a -m "Initial commit" |
13 | | - git push origin -f "$(FIXTURE_BASE_BRANCH)" |
| 11 | + git commit -m "Initial commit" |
| 12 | + git push origin -f "$(FIXTURE_BRANCH)" |
14 | 13 |
|
15 | 14 | # Test#1 |
16 | 15 | # It updates an image tag of Deployment. |
17 | 16 | # It will cause the rolling update, that is, Progressing state. |
18 | | -update-manifest-app1: |
19 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
20 | | - git checkout -b "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app1" |
| 17 | +deploy-app1: |
| 18 | + git checkout "$(FIXTURE_BRANCH)" |
21 | 19 | sed -i -e 's/echoserver:1.8/echoserver:1.9/g' app1/deployment/echoserver.yaml |
22 | | - echo 'deploymentURL: $(DEPLOYMENT_URL)' > app1/metadata.yaml |
23 | | - git commit -a -m 'e2e-test: update-manifest-app1' |
24 | | - git push origin -f "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app1" |
25 | | - gh pr create --base "$(FIXTURE_BASE_BRANCH)" --fill --body "$(PULL_REQUEST_BODY)" --label e2e-test |
26 | | - gh pr merge --squash |
27 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
28 | | - git pull origin "$(FIXTURE_BASE_BRANCH)" --ff-only |
| 20 | + bash deploy.sh app1 |
29 | 21 |
|
30 | 22 | # Test#2 |
31 | 23 | # It updates the label to invalid value. |
32 | 24 | # It will cause this error: |
33 | 25 | # one or more objects failed to apply, reason: Deployment.apps "echoserver" is invalid: spec.selector: Invalid value: v1.LabelSelector |
34 | | -update-manifest-app2: |
35 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
36 | | - git checkout -b "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app2" |
| 26 | +deploy-app2: |
| 27 | + git checkout "$(FIXTURE_BRANCH)" |
37 | 28 | sed -i -e 's/app: echoserver/app: echoserver-test2/g' app2/deployment/echoserver.yaml |
38 | | - echo 'deploymentURL: $(DEPLOYMENT_URL)' > app2/metadata.yaml |
39 | | - git commit -a -m 'e2e-test: update-manifest-app2' |
40 | | - git push origin -f "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app2" |
41 | | - gh pr create --base "$(FIXTURE_BASE_BRANCH)" --fill --body "$(PULL_REQUEST_BODY)" --label e2e-test |
42 | | - gh pr merge --squash |
43 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
44 | | - git pull origin "$(FIXTURE_BASE_BRANCH)" --ff-only |
| 29 | + bash deploy.sh app2 |
45 | 30 |
|
46 | 31 | # Test#3 |
47 | 32 | # It updates an image tag of CronJob template. |
48 | 33 | # Application will not transit to Progressing state. |
49 | | -update-manifest-app3: |
50 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
51 | | - git checkout -b "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app3" |
| 34 | +deploy-app3: |
| 35 | + git checkout "$(FIXTURE_BRANCH)" |
52 | 36 | sed -i -e 's/busybox:1.28/busybox:1.30/g' app3/cronjob/echoserver.yaml |
53 | | - echo 'deploymentURL: $(DEPLOYMENT_URL)' > app3/metadata.yaml |
54 | | - git commit -a -m 'e2e-test: update-manifest-app3' |
55 | | - git push origin -f "$(FIXTURE_BRANCH_PREFIX)/update-manifest-app3" |
56 | | - gh pr create --base "$(FIXTURE_BASE_BRANCH)" --fill --body "$(PULL_REQUEST_BODY)" --label e2e-test |
57 | | - gh pr merge --squash |
58 | | - git checkout "$(FIXTURE_BASE_BRANCH)" |
59 | | - git pull origin "$(FIXTURE_BASE_BRANCH)" --ff-only |
| 37 | + bash deploy.sh app3 |
0 commit comments