-
Notifications
You must be signed in to change notification settings - Fork 35
92 lines (84 loc) · 3.63 KB
/
verify-kubespray.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
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
name: 4. Daily Kubespray verify
on:
workflow_dispatch: #manual run
schedule:
- cron: '0 18 * * *'
env:
VSPHERE_USER: ${{ secrets.VSPHERE_USER }}
VSPHERE_PASSWD: ${{ secrets.VSPHERE_PASSWD }}
AMD_ROOT_PASSWORD: ${{ secrets.AMD_ROOT_PASSWORD }}
KYLIN_VM_PASSWORD: ${{ secrets.KYLIN_VM_PASSWORD }}
jobs:
output-variable:
runs-on: ubuntu-latest
outputs:
repo: ${{ steps.output_variables.outputs.repo }}
spray_version: ${{ steps.output_variables.outputs.spray_version }}
spray_short_sha: ${{ steps.output_variables.outputs.spray_short_sha }}
container_tag: ${{ steps.output_variables.outputs.container_tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: output environment variable
id: output_variables
run: |
spray_version=`git ls-remote --head https://github.com/kubernetes-sigs/kubespray.git refs/heads/master | awk -F ' ' '{print $1}'` # get kubespray master head commit id sha
echo spray_version=${spray_version} >> $GITHUB_OUTPUT
echo spray_short_sha=$(echo ${spray_version} | cut -c 1-7) >> $GITHUB_OUTPUT
ORGANIZATION_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F "/" '{print $1}' | tr '[:upper:]' '[:lower:]')
echo repo=${ORGANIZATION_NAME} >> $GITHUB_OUTPUT
echo container_tag=v$(date '+%Y%m%d') >> $GITHUB_OUTPUT
build-spray-imgs: #build kubespray base image
needs: [output-variable]
uses: ./.github/workflows/call-build-imgs-for-spray.yaml
secrets: inherit
with:
SPRAY_REF: ${{ needs.output-variable.outputs.spray_version }}
REPO: ${{ needs.output-variable.outputs.repo }}
build-kubean-imgs:
needs: [output-variable, build-spray-imgs]
uses: ./.github/workflows/call-build-imgs-for-kubean.yaml
secrets: inherit
with:
SPRAY_IMG_TAG: ${{ needs.output-variable.outputs.spray_short_sha }}
REPO: ${{ needs.output-variable.outputs.repo }}
BUILD_IMG_TAG: ${{ needs.output-variable.outputs.container_tag }}
verify_kubespray_e2e_test:
needs: [ output-variable, build-spray-imgs,build-kubean-imgs ]
runs-on: [self-hosted, online]
timeout-minutes: 900
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ needs.get_ref.outputs.ref }}
- uses: actions/setup-go@v4
with:
go-version: 1.22.4
- name: verify_kubespray_e2e_test
env:
CONTAINER_TAG: ${{ needs.output-variable.outputs.container_tag }}
run: |
temp_tag="$(git describe --tags --abbrev=8 --dirty)-e2e"
HELM_CHART_VERSION=`echo ${temp_tag}|awk -F "-" '{print $1}'`
TAG_SECOND_PART=`echo ${CONTAINER_TAG}|awk -F "-" '{print $2 }'`
if [[ ${TAG_SECOND_PART} =~ rc[0-9]+ ]];then
HELM_CHART_VERSION=`echo ${CONTAINER_TAG}|awk -F "-" '{print $1"-"$2 }'`
fi
echo ${{ runner.name }}
echo ${{ runner.os }}
echo ${{ runner.arch }}
echo ${{ github.workspace }}
export KUBE_VERSION=v1.30.5
bash hack/e2e.sh "${HELM_CHART_VERSION}" "${CONTAINER_TAG}" ${{ runner.name }} "${VSPHERE_USER}" "${VSPHERE_PASSWD}" "${AMD_ROOT_PASSWORD}" "${KYLIN_VM_PASSWORD}" "PR"
print_kubespray_commit_sha:
needs: [output-variable, verify_kubespray_e2e_test]
runs-on: ubuntu-latest
steps:
- name: print_kubespray_commit_sha
run: |
echo "📢📢📢kubespray commit ID SHA that pass kubean e2e test: " ${{ needs.output-variable.outputs.spray_version }}, ${{ needs.output-variable.outputs.spray_short_sha }}