This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
107 lines (85 loc) · 2.9 KB
/
module_controller_ci_build_deploy_to_aliyun.yml
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
106
107
name: Module Controller Integration Test
run-name: ${{ github.actor }} pushed module-controller code
on:
push:
branches:
- master
paths:
- 'module-controller/**'
pull_request:
branches:
- master
paths:
- 'module-controller/**'
# enable manually running the workflow
workflow_dispatch:
env:
CGO_ENABLED: 0
GOOS: linux
WORK_DIR: module-controller
defaults:
run:
working-directory: module-controller
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Minikube
run: |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
- name: Start Minikube
run: minikube start
- name: Prepare development env
run: |
kubectl apply -f config/crd/bases/serverless.alipay.com_moduledeployments.yaml
kubectl apply -f config/crd/bases/serverless.alipay.com_modulereplicasets.yaml
kubectl apply -f config/crd/bases/serverless.alipay.com_modules.yaml
kubectl apply -f config/crd/bases/serverless.alipay.com_moduletemplates.yaml
kubectl apply -f config/rbac/role.yaml
kubectl apply -f config/rbac/role_binding.yaml
kubectl apply -f config/rbac/service_account.yaml
kubectl apply -f config/samples/dynamic-stock-deployment.yaml
kubectl apply -f config/samples/module-deployment-controller.yaml
kubectl apply -f config/samples/dynamic-stock-service.yaml
- run: sleep 60
- name: minikube logs
run: minikube logs
- name: get pod
run: |
kubectl get pod
- name: describe pod
run: |
kubectl describe pod
- name: wait base pod available
run: |
kubectl wait --for=condition=available deployment/dynamic-stock-deployment --timeout=300s
- name: get module controller pod available
run: |
kubectl wait --for=condition=available deployment/module-controller --timeout=300s
- name: Apply moduledeployment
run: |
kubectl apply -f config/samples/module-deployment_v1alpha1_moduledeployment_facade.yaml
- name: get moduledeployment
run: |
kubectl get moduledeployment
- name: get modulereplicaset
run: |
kubectl get modulereplicaset
- run: sleep 5
- name: get module
run: |
kubectl get module -oyaml
- name: exist module
run: |
moduleCount=$(kubectl get module | wc -l)
if [[ $moduleCount -lt 1 ]]; then
echo "ERROR: 不存在module"
exit 1
fi
- name: check service
run: |
url=$(minikube service --url dynamic-stock-service)
response=$(curl -s "$url")
echo "$response"