@@ -19,8 +19,26 @@ case "$ID" in
19
19
esac
20
20
21
21
if [ " $TMT_REBOOT_COUNT " -eq 0 ]; then
22
- # Copy bootc root folder to image build root folder
23
- cp -a ../../. " $BOOTC_TEMPDIR "
22
+ # Fedora CI: https://github.com/fedora-ci/dist-git-pipeline/blob/master/Jenkinsfile#L145
23
+ # OSCI: https://gitlab.cee.redhat.com/osci-pipelines/dist-git-pipeline/-/blob/master/Jenkinsfile?ref_type=heads#L93
24
+ if [[ -v KOJI_TASK_ID ]] || [[ -v CI_KOJI_TASK_ID ]]; then
25
+ # Just left those ls commands here to ring the bell for me when something changed
26
+ echo " $TMT_SOURCE_DIR "
27
+ ls -al " $TMT_SOURCE_DIR "
28
+ ls -al " $TMT_SOURCE_DIR /SRPMS"
29
+ ls -al /etc/yum.repos.d
30
+ cat /etc/yum.repos.d/test-artifacts.repo
31
+ ls -al /var/share/test-artifacts
32
+
33
+ # hack and tmt folders in dist source are required by test
34
+ cp -a ../../hack " $BOOTC_TEMPDIR "
35
+ cp -a ../../tmt " $BOOTC_TEMPDIR "
36
+ # bootc CI
37
+ else
38
+ # Copy bootc root folder to image build root folder
39
+ # Required by bootc CI to build bootc binary
40
+ cp -a ../../. " $BOOTC_TEMPDIR "
41
+ fi
24
42
25
43
# TMT needs this key
26
44
cp -r /root/.ssh " $BOOTC_TEMPDIR "
@@ -40,31 +58,15 @@ if [ "$TMT_REBOOT_COUNT" -eq 0 ]; then
40
58
ls -al " $BOOTC_TEMPDIR "
41
59
42
60
CONTAINERFILE=${BOOTC_TEMPDIR} /Containerfile
43
- tee " $CONTAINERFILE " > /dev/null << REALEOF
44
- FROM $TIER1_IMAGE_URL as build
45
-
46
- COPY contrib /contrib
47
- COPY hack/build.sh /build.sh
48
- RUN /build.sh && rm -v /build.sh
49
- COPY . /build
50
- WORKDIR /build
51
-
52
- RUN mkdir -p /build/target/dev-rootfs
53
- RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
54
-
55
- FROM $TIER1_IMAGE_URL
56
61
62
+ COMMON_CONTAINERFILE=" ${BOOTC_TEMPDIR} /common_containerfile"
63
+ tee " $COMMON_CONTAINERFILE " > /dev/null << COMMONEOF
57
64
COPY hack/provision-derived.sh /tmp
58
65
RUN /tmp/provision-derived.sh && rm -f /tmp/*.sh
59
66
# Also copy in some default install configs we use for testing
60
67
COPY hack/install-test-configs/* /usr/lib/bootc/install/
61
68
# And some test kargs
62
69
COPY hack/test-kargs /usr/lib/bootc/kargs.d/
63
- # Inject our built code
64
- COPY --from=build /out/bootc.tar.zst /tmp
65
- RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
66
- # Also copy over arbitrary bits from the target root
67
- COPY --from=build /build/target/dev-rootfs/ /
68
70
69
71
RUN <<EORUN
70
72
set -xeuo pipefail
@@ -91,7 +93,49 @@ COPY bin /usr/local/bin
91
93
92
94
# In Testing Farm, all ssh things should be reserved for ssh command run after reboot
93
95
COPY .ssh /var/roothome/.ssh
96
+ COMMONEOF
97
+
98
+ if [[ -v KOJI_TASK_ID ]] || [[ -v CI_KOJI_TASK_ID ]]; then
99
+ FEDORA_CI_CONTAINERFILE=" ${BOOTC_TEMPDIR} /fedora_ci_containerfile"
100
+ tee " $FEDORA_CI_CONTAINERFILE " > /dev/null << FEDORACIEOF
101
+ FROM $TIER1_IMAGE_URL
102
+
103
+ RUN dnf -y upgrade /rpms/*.rpm
104
+ FEDORACIEOF
105
+ cat > " $CONTAINERFILE " << REALEOF
106
+ $( cat " $FEDORA_CI_CONTAINERFILE " )
107
+ $( cat " $COMMON_CONTAINERFILE " )
108
+
94
109
REALEOF
110
+ else
111
+ BOOTC_CI_CONTAINERFILE=" ${BOOTC_TEMPDIR} /bootc_ci_containerfile"
112
+ tee " $BOOTC_CI_CONTAINERFILE " > /dev/null << BOOTCCIEOF
113
+ FROM $TIER1_IMAGE_URL as build
114
+
115
+ COPY contrib /contrib
116
+ COPY hack/build.sh /build.sh
117
+ RUN /build.sh && rm -v /build.sh
118
+ COPY . /build
119
+ WORKDIR /build
120
+
121
+ RUN mkdir -p /build/target/dev-rootfs
122
+ RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
123
+
124
+ FROM $TIER1_IMAGE_URL
125
+
126
+ # Inject our built code
127
+ COPY --from=build /out/bootc.tar.zst /tmp
128
+ RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
129
+ # Also copy over arbitrary bits from the target root
130
+ COPY --from=build /build/target/dev-rootfs/ /
131
+
132
+ BOOTCCIEOF
133
+ cat > " $CONTAINERFILE " << REALEOF
134
+ $( cat " $BOOTC_CI_CONTAINERFILE " )
135
+ $( cat " $COMMON_CONTAINERFILE " )
136
+ REALEOF
137
+ fi
138
+
95
139
96
140
if [[ -d " /var/ARTIFACTS" ]]; then
97
141
# In Testing Farm, TMT work dir /var/ARTIFACTS should be reserved
@@ -112,7 +156,7 @@ REALEOF
112
156
113
157
cat " $CONTAINERFILE "
114
158
# Retry here to avoid quay.io "502 Bad Gateway"
115
- podman build --retry 5 --retry-delay 5s --tls-verify=false -t localhost/bootc:tmt -f " $CONTAINERFILE " " $BOOTC_TEMPDIR "
159
+ podman build --retry 5 --retry-delay 5s --tls-verify=false -v /var/share/test-artifacts:/rpms:z - t localhost/bootc:tmt -f " $CONTAINERFILE " " $BOOTC_TEMPDIR "
116
160
117
161
podman images
118
162
podman run \
0 commit comments