2222 DOCKERHUB_TOKEN : ${{ secrets.E2E_DOCKERHUB_TOKEN }}
2323 # for apps
2424 IMAGE_REPO_PASSWORD : ${{ secrets.E2E_DOCKERHUB_TOKEN }}
25+ # token for gitlab.com (of aFlyBird0 now)
26+ GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
2527
2628concurrency :
2729 group : ${{ github.workflow }}
7274 sudo mv ./kubectl /usr/local/bin/kubectl
7375 - name : copy config files
7476 run : cp ./test/e2e/yaml/e2e-*.yaml ./
77+ # test 1 is git-ops with tools only
7578 - name : test 1 - apply git-ops (tools only)
7679 run : ./dtm apply -f e2e-tools.yaml -y
7780 - name : test 1 - apply git-ops (tools only) again
@@ -83,21 +86,38 @@ jobs:
8386 run : ./dtm verify -f e2e-tools.yaml
8487 - name : test 1 - clean
8588 run : ./dtm delete -f e2e-tools.yaml -y
89+ # test 2 is git-ops with apps
8690 - name : test 2 - apply (apps)
8791 run : ./dtm apply --debug -f e2e-apps.yaml -y
8892 - name : test 2 - apply (apps) again
8993 run : ./dtm apply -f e2e-apps.yaml -y
9094 - name : test 2 - check if pod is ready
9195 run : while [[ $(kubectl get pods -l app=dtm-e2e-go -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done
9296 timeout-minutes : 10
93- - name : test 3 - check flask app can be reached
94- run :
97+ - name : test 2 - check flask app can be reached
98+ run : |
9599 # get cluster ip of the service created by the argocd
96- clusterIP=$(kubectl get svc helloworld -n default -o jsonpath='{.spec.clusterIP}')
100+ clusterIP=$(kubectl get svc dtm-e2e-go -n default -o jsonpath='{.spec.clusterIP}')
97101 # curl flask url and check if it returns "Hello, World!", if not, echo error and exit 1
98102 curl -s http://$clusterIP:8080 | grep "Hello, World!" || (echo "failed to access to flask app" && exit 1)
99103 - name : test 2 - clean
100104 run : ./dtm delete -f e2e-apps.yaml -y
105+ # test3 is gitlabci-argocd
106+ - name : test 3 - apply (gitlabci-argocd)
107+ run : ./dtm apply --debug -f e2e-gitlabci-argocd.yaml -y
108+ - name : test 3 - apply (gitlabci-argocd) again
109+ run : ./dtm apply -f e2e-gitlabci-argocd.yaml -y
110+ - name : test 3 - check if pod is ready
111+ run : while [[ $(kubectl get pods -l app=dtme2egitlabciargocd -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done
112+ timeout-minutes : 10
113+ - name : test 3 - check flask app can be reached
114+ run : |
115+ # get cluster ip of the service created by the argocd
116+ clusterIP=$(kubectl get svc dtme2egitlabciargocd -n default -o jsonpath='{.spec.clusterIP}')
117+ # curl flask url and check if it returns "Hello, World!", if not, echo error and exit 1
118+ curl -s http://$clusterIP:8080 | grep "Hello, World!" || (echo "failed to access to flask app" && exit 1)
119+ - name : test 2 - clean
120+ run : ./dtm delete -f e2e-gitlabci-argocd.yaml -y
101121 - name : test e2e success or not
102122 if : failure()
103123 run : |
0 commit comments