Skip to content

Commit a1fd5d2

Browse files
committed
bump
1 parent befacb8 commit a1fd5d2

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

.github/workflows/generic_build.yml

+16-20
Original file line numberDiff line numberDiff line change
@@ -134,41 +134,37 @@ jobs:
134134
image_id="$( cat "${iidfile}" )"
135135
rm "${iidfile}"
136136
137-
# Extract various package info and version info, then store that info as labels
137+
# Extract various package info and version info, then store that info
138+
# as labels. Container is removed at the end to avoid e.g. having these
139+
# commands in the history of the container.
138140
container="$( buildah from "${image_id}" )"
139141
run() { buildah run "${container}" "${@}" ; }
140-
deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )"
141-
pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )"
142-
glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )"
143-
debian="$( run cat /etc/debian_version | sed '1!d' )"
144-
bash="$( run bash --version | sed '1!d' )"
142+
LABELS=()
143+
LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"")
144+
LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"")
145+
LABELS+=("--label=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"")
146+
LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"")
147+
LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"")
145148
146149
if [ "${bioconda_utils}" ]; then
147150
bioconda_utils="$(
148151
run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \
149152
| rev | cut -f1 -d " " | rev
150153
)"
151-
buildah config --label=bioconda-utils="${bioconda_utils}" ${container}
154+
LABELS+=("--label=\"${bioconda_utils}\"")
152155
fi
153156
154157
if [ ! -z "${busybox_version}" ]; then
155-
buildah config --label=busybox-version="${busybox_version}"
158+
LABELS+=("--label=busybox-version=\"${busybox_version}\"")
156159
fi
157160
buildah rm "${container}"
158161
159-
# TODO: use array for labels, and make sure this next container is
160-
# the one getting the labels (above, bioconda-utils is added to the
161-
# first container which is then rmed)
162+
# Add labels to a new container...
162163
container="$( buildah from "${image_id}" )"
163-
buildah config \
164-
--label=glibc="${glibc}" \
165-
--label=debian="${debian}" \
166-
--label=bash="${bash}" \
167-
--label=deb-list="${deb_list}" \
168-
--label=pkg-list="${pkg_list}" \
169-
"${container}"
170-
171-
# Store the new image (now with labels)
164+
buildah config ${LABELS[@]} "${container}"
165+
166+
# ...then store the container (now with labels) as a new image. This
167+
# is what we'll use to upload.
172168
image_id="$( buildah commit "${container}" )"
173169
buildah rm "${container}"
174170

0 commit comments

Comments
 (0)