diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6586e070 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +all: + +setup: + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git checkout -B "$(FIXTURE_BRANCH)/main" + git add . + git commit -a -m "Initial commit" + git push origin -f "$(FIXTURE_BRANCH)/main" + +test1: + git checkout "$(FIXTURE_BRANCH)/main" + git checkout -b "$(FIXTURE_BRANCH)/test1" + sed -i -e 's/name: echoserver/name: echoserver-test1/g' app1/deployment/echoserver.yaml + git commit -a -m 'e2e-test: app1' + git push origin -f "$(FIXTURE_BRANCH)/test1" + gh pr create --base "$(FIXTURE_BRANCH)/main" --fill --body "$(PULL_REQUEST_BODY)" --label e2e-test + gh pr merge --squash + git checkout "$(FIXTURE_BRANCH)/main" + git pull origin "$(FIXTURE_BRANCH)/main" --ff-only + +test2: + git checkout "$(FIXTURE_BRANCH)/main" + git checkout -b "$(FIXTURE_BRANCH)/test2" + sed -i -e 's/app: echoserver/app: echoserver-test2/g' app2/deployment/echoserver.yaml + git commit -a -m 'e2e-test: app2' + git push origin -f "$(FIXTURE_BRANCH)/test2" + gh pr create --base "$(FIXTURE_BRANCH)/main" --fill --body "$(PULL_REQUEST_BODY)" --label e2e-test + gh pr merge --squash + git checkout "$(FIXTURE_BRANCH)/main" + git pull origin "$(FIXTURE_BRANCH)/main" --ff-only diff --git a/app1/deployment/echoserver.yaml b/app1/deployment/echoserver.yaml new file mode 100644 index 00000000..809a42fb --- /dev/null +++ b/app1/deployment/echoserver.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: echoserver +spec: + replicas: 1 + selector: + matchLabels: + app: echoserver + template: + metadata: + labels: + app: echoserver + spec: + containers: + - image: gcr.io/google_containers/echoserver:1.8 + name: echoserver + ports: + - containerPort: 8080 diff --git a/app1/kustomization.yaml b/app1/kustomization.yaml new file mode 100644 index 00000000..c3f77116 --- /dev/null +++ b/app1/kustomization.yaml @@ -0,0 +1,4 @@ +namespace: app1 +resources: + - namespace/app1.yaml + - deployment/echoserver.yaml diff --git a/app1/namespace/app1.yaml b/app1/namespace/app1.yaml new file mode 100644 index 00000000..f39399ba --- /dev/null +++ b/app1/namespace/app1.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: app1 diff --git a/app2/deployment/echoserver.yaml b/app2/deployment/echoserver.yaml new file mode 100644 index 00000000..809a42fb --- /dev/null +++ b/app2/deployment/echoserver.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: echoserver +spec: + replicas: 1 + selector: + matchLabels: + app: echoserver + template: + metadata: + labels: + app: echoserver + spec: + containers: + - image: gcr.io/google_containers/echoserver:1.8 + name: echoserver + ports: + - containerPort: 8080 diff --git a/app2/kustomization.yaml b/app2/kustomization.yaml new file mode 100644 index 00000000..dbcfd321 --- /dev/null +++ b/app2/kustomization.yaml @@ -0,0 +1,4 @@ +namespace: app2 +resources: + - namespace/app2.yaml + - deployment/echoserver.yaml diff --git a/app2/namespace/app2.yaml b/app2/namespace/app2.yaml new file mode 100644 index 00000000..b990c93e --- /dev/null +++ b/app2/namespace/app2.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: app2