-
Notifications
You must be signed in to change notification settings - Fork 21
65 lines (55 loc) · 2.08 KB
/
cicd.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
name: Build and Deploy Go Application
on:
pull_request:
issue_comment:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/cicheck')) }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: 1.18
- name: Install kustomize
run: |
make kustomize
- name: Install controller-gen
run: |
make controller-gen
- name: Verify code
run: |
make fmt
make vet
make manifests
- name: Compile code
run: |
go mod tidy
go mod vendor
make curve-operator
- name: Create cluster
run: |
sudo swapoff -a
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/kubernetes-archive-keyring.gpg
sudo echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl=1.20.15-00 kubelet=1.20.15-00 kubeadm=1.20.15-00
sudo apt-mark hold kubelet kubeadm kubectl
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
- name: Docker build
run: |
make docker-build
- name: Deploy manfiests
run: |
make deploy
kubectl --namespace curve wait --for=condition=ready --timeout=300s pod -l curve=operator
kubectl --namespace curve get pod