forked from kubevirt/kubevirtci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·62 lines (48 loc) · 2.43 KB
/
publish.sh
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
#!/bin/bash
set -ex
KUBEVIRTCI_TAG=$(date +"%y%m%d%H%M")-$(git rev-parse --short HEAD)
export KUBEVIRTCI_TAG
TARGET_REPO="quay.io/kubevirtci"
TARGET_KUBEVIRT_REPO="quay.io/kubevirt"
TARGET_GIT_REMOTE="https://[email protected]/kubevirt/kubevirtci.git"
# Build gocli
(cd cluster-provision/gocli && make container)
docker tag ${TARGET_REPO}/gocli ${TARGET_REPO}/gocli:${KUBEVIRTCI_TAG}
# Provision all base images
(cd cluster-provision/centos8 && ./build.sh)
(cd cluster-provision/centos9 && ./build.sh)
# Provision all clusters
CLUSTERS="$(find cluster-provision/k8s/* -maxdepth 0 -type d -printf '%f\n')"
for i in ${CLUSTERS}; do
cluster-provision/gocli/build/cli provision cluster-provision/k8s/$i
docker tag ${TARGET_REPO}/k8s-$i ${TARGET_REPO}/k8s-$i:${KUBEVIRTCI_TAG}
cluster-provision/gocli/build/cli provision cluster-provision/k8s/$i --slim
docker tag ${TARGET_REPO}/k8s-$i ${TARGET_REPO}/k8s-$i:${KUBEVIRTCI_TAG}-slim
done
# Provision alpine container disk and tag it
(cd cluster-provision/images/vm-image-builder && ./create-containerdisk.sh alpine-cloud-init)
docker tag alpine-cloud-init:devel ${TARGET_REPO}/alpine-with-test-tooling-container-disk:${KUBEVIRTCI_TAG}
docker tag alpine-cloud-init:devel ${TARGET_KUBEVIRT_REPO}/alpine-with-test-tooling-container-disk:devel
# Push all images
# until "unknown blob" issue is fixed use skopeo to push image
# see https://github.com/moby/moby/issues/43234
IMAGES="${CLUSTERS}"
TARGET_IMAGE="${TARGET_REPO}/gocli:${KUBEVIRTCI_TAG}"
skopeo copy "docker-daemon:${TARGET_IMAGE}" "docker://${TARGET_IMAGE}"
#docker push ${TARGET_IMAGE}
for i in ${IMAGES}; do
TARGET_IMAGE="${TARGET_REPO}/k8s-$i:${KUBEVIRTCI_TAG}"
skopeo copy "docker-daemon:${TARGET_IMAGE}" "docker://${TARGET_IMAGE}"
#docker push ${TARGET_IMAGE}
TARGET_IMAGE="${TARGET_REPO}/k8s-$i:${KUBEVIRTCI_TAG}-slim"
skopeo copy "docker-daemon:${TARGET_IMAGE}" "docker://${TARGET_IMAGE}"
done
TARGET_IMAGE="${TARGET_REPO}/alpine-with-test-tooling-container-disk:${KUBEVIRTCI_TAG}"
skopeo copy "docker-daemon:${TARGET_IMAGE}" "docker://${TARGET_IMAGE}"
#docker push ${TARGET_IMAGE}
TARGET_KUBEVIRT_IMAGE="${TARGET_KUBEVIRT_REPO}/alpine-with-test-tooling-container-disk:devel"
skopeo copy "docker-daemon:${TARGET_KUBEVIRT_IMAGE}" "docker://${TARGET_KUBEVIRT_IMAGE}"
git config user.name "kubevirt-bot"
git config user.email "[email protected]"
git tag ${KUBEVIRTCI_TAG}
git push ${TARGET_GIT_REMOTE} ${KUBEVIRTCI_TAG}