forked from osism/k8s-capi-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
75 lines (64 loc) · 2.61 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
# 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[3cbae51bb9bbab4bb216638bde05aef2bf0ab46541238c37a9f2ed18aca74e392995b24128827cf32ac5b5ba0ab607dd]"
MINIO_SECRET_KEY: "ENCRYPTED[8f2b0f75c64c88e70bd2e55a2798678d049e9a28895c0c1ad805070a74c3583df6e9080535ff9151fdc8777dc7d207c0]"
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
- apt-get install -y curl git software-properties-common
- curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
- apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com focal main"
- apt-add-repository --yes --update ppa:ansible/ansible
- apt-get install -y ansible packer
prepare_script:
- git clone https://github.com/kubernetes-sigs/image-builder
- ansible-playbook -i localhost, playbooks/pre.yml -e working_directory=$CIRRUS_WORKING_DIR
build_script:
- cd image-builder/images/capi
- make build-qemu-ubuntu-2204
prepare_push_script:
- wget https://dl.min.io/client/mc/release/linux-amd64/mc
- chmod +x mc
- ./mc alias set minio https://minio.services.osism.tech $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
- cd image-builder/images/capi/output
- find . -type f -execdir bash -c 'x={}; cp $x ${x%.*}.qcow2; mv $x $x.qcow2' \;
- find . -type f -execdir bash -c 'x={}; virt-sparsify --in-place $x' \;
- find . -type f -execdir bash -c 'x={}; sha256sum $x > $x.CHECKSUM' \;
- du -h
push_script:
- ./mc cp --recursive image-builder/images/capi/output/* minio/openstack-k8s-capi-images
- ./mc policy set download minio/openstack-k8s-capi-images
build_125_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_125.json')"
env:
PACKER_VAR_FILES: ../../../extra_vars_125.json
build_126_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_126.json')"
env:
PACKER_VAR_FILES: ../../../extra_vars_126.json
build_127_task:
<<: *BUILD_TASK_TEMPLATE
skip: "!changesInclude('extra_vars_127.json')"
env:
PACKER_VAR_FILES: ../../../extra_vars_127.json