-
Notifications
You must be signed in to change notification settings - Fork 2
/
.cirrus.yml
86 lines (75 loc) · 3.09 KB
/
.cirrus.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
---
# NOTE: That didn't work, thus use of instance with nested virtualization enabled.
#
# container:
# image: ubuntu:20.04
# kvm: true
compute_engine_instance:
image_project: cirrus-images
image: family/docker-kvm
platform: linux
cpu: 4
memory: 16G
disk: 100
nested_virtualization: true
# environment variables
env:
DEBIAN_FRONTEND: noninteractive
HOME: "$CIRRUS_WORKING_DIR"
PACKER_TMP_DIR: "$CIRRUS_WORKING_DIR/.packer.d"
MINIO_ACCESS_KEY: "ENCRYPTED[f1e5f3b5e72297422e2ec817e8833a2e8d69fe75e3db78a7e4ba20581578752d6f6f61d1ed1d1254b6b54b7ae8bc6af9]"
MINIO_SECRET_KEY: "ENCRYPTED[adba7892ef6bb89524abc57e38b401e77a268d129c44cd792a9dd064b8dcb0cf050dd4e906059d0f94ae4ac92d8e869b]"
build_task_template: &BUILD_TASK_TEMPLATE
timeout_in: 120m
install_script: |
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done;
while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done;
apt-get update
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done;
while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do sleep 5; done;
apt-get install -y git make python3-pip curl jq unzip
prepare_script: |
git clone https://github.com/kubernetes-sigs/image-builder
cd image-builder/images/capi
export PATH=$PWD/.bin:$HOME/.local/bin:$PATH
make deps-qemu
build_script: |
cd image-builder/images/capi
export PATH=$PWD/.bin:$HOME/.local/bin:$PATH
make build-qemu-ubuntu-2204
prepare_push_script: |
pushd image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER
find . -type f -execdir bash -c 'x={}; cp $x ${x%.*}.qcow2; mv $x $x.qcow2' \;
find . -name '*.qcow2' -execdir bash -c 'x={}; sha256sum $(basename $x) > $x.CHECKSUM' \;
find . -name "*$IMAGE_IDENTIFIER.*.qcow2" -execdir bash -c 'x={}; echo $(date +%Y-%m-%d) ubuntu-2204-kube-v$IMAGE_IDENTIFIER/$(basename $x) > last-$IMAGE_IDENTIFIER' \;
ls -lah
popd
mv image-builder/images/capi/output/ubuntu-2204-kube-v$IMAGE_IDENTIFIER/last-$IMAGE_IDENTIFIER .
cat last-$IMAGE_IDENTIFIER
push_script: |
if [[ "$CIRRUS_BRANCH" == "main" ]]; then
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc alias set minio https://swift.services.a.regiocloud.tech $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
./mc cp last-$IMAGE_IDENTIFIER minio/openstack-k8s-capi-images
./mc cp --recursive image-builder/images/capi/output/* minio/openstack-k8s-capi-images
./mc policy set download minio/openstack-k8s-capi-images
fi
build_129_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_129.json', '.cirrus.yml')"
env:
IMAGE_IDENTIFIER: "1.29"
PACKER_VAR_FILES: ../../../extra_vars_129.json
build_130_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_130.json', '.cirrus.yml')"
env:
IMAGE_IDENTIFIER: "1.30"
PACKER_VAR_FILES: ../../../extra_vars_130.json
build_131_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_131.json', '.cirrus.yml')"
env:
IMAGE_IDENTIFIER: "1.31"
PACKER_VAR_FILES: ../../../extra_vars_131.json