-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (98 loc) · 3.18 KB
/
Copy pathbuild.yml
File metadata and controls
108 lines (98 loc) · 3.18 KB
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
108
name: build
on:
push:
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- '.markdownlint.yaml'
- '*.md'
env:
ARTIFACTS_PATH: artifacts
PROJECT_NAME: exordos_core
REPO_ENDPOINT_PUT: http://10.20.0.1:8082
PACKER_VERSION: "1.9.2"
CORE_ENDPOINT_URL: http://10.20.0.2:11010
CORE_USERNAME: "admin"
CORE_PASSWORD: "admin"
jobs:
Build:
runs-on: [ self-hosted, vm ]
if: ${{ github.actor != 'dependabot[bot]' }}
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 50
- name: Build Exordos Core
env:
PUSH_CFG: ${{ secrets.PUSH_CFG }}
run: |
set -eux
mkdir -p ${ARTIFACTS_PATH}
source ~/.profile
VERSION="$(exordos get-version .)"
# Build Exordos Core
export GEN_IMG_FORMAT_CORE=qcow2,zst
exordos build $(pwd)
# Decode and write the push configuration
echo "$PUSH_CFG" | base64 -d > exordos/exordos.push.yaml
exordos push -c exordos/exordos.push.yaml -t local -f --latest
# Temporary upload step is done in the build script
echo "${VERSION}" > "${ARTIFACTS_PATH}/version.txt"
- name: Upload the build artifacts
uses: actions/upload-artifact@v7
with:
name: build_artifacts
path: artifacts/
FuncTests:
needs: Build
if : ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Setup `packer`
uses: hashicorp/setup-packer@main
with:
version: ${{ env.PACKER_VERSION }}
- name: Install exordos
run: curl -fsSL https://repo.exordos.com/install.sh | sudo sh
- name: set exordos config
run: |
exordos settings set-realm default --endpoint $CORE_ENDPOINT_URL
exordos settings set-context default --name default --user $CORE_USERNAME --password $CORE_PASSWORD
- name: Install hypervisor
run: sudo exordos compute hypervisors init
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build_artifacts
path: artifacts/
- name: bootstrap exordos core
run: |
VERSION=$(cat artifacts/version.txt)
exordos bootstrap -i $VERSION -f -m core --admin-password $CORE_PASSWORD --cidr 10.20.0.0/22
- name: check exordos core
timeout-minutes: 10
run: |
# set -eux
for i in {1..10}; do
if exordos ready_api; then
echo "Exordos Core API is ready"
break
fi
echo "Waiting for Exordos Core API... ($i/10)"
sleep 5
done
while [ $(exordos ee l -o json -f name=core | jq -r .[0]."Status") != "ACTIVE" ]; do
sleep 2
done
exordos e e show core
exordos compute nodes list
exordos compute hypervisors list
- name: Setup upterm session
uses: owenthereal/action-upterm@v1
if: ${{ failure() }}
with:
limit-access-to-actor: true
wait-timeout-minutes: 30