mini-mirror: Preserve codename and label
Ubuntu 18.04 performs strict checking of the Codename and Label when performing an apt-get update. The snapshots published by aptly do not set these parameters in a way that apt-get likes. This change explicitly sets the codename and label based on the values from the upstream repo being mirrored. Note: this relies on a currently unmerged pull request/ https://github.com/aptly-dev/aptly/pull/892 Change-Id: I011862dcf9efbb8b1f9757c65f3d58da49a496d7
This commit is contained in:
parent
6c3f46abd8
commit
066efa5767
|
@ -26,8 +26,8 @@ COPY "${APTLY_CONFIG_PATH}" /etc/aptly.conf
|
||||||
COPY tools/install_aptly.sh /opt/install_aptly.sh
|
COPY tools/install_aptly.sh /opt/install_aptly.sh
|
||||||
|
|
||||||
ARG APTLY_INSTALL_FROM=source
|
ARG APTLY_INSTALL_FROM=source
|
||||||
ARG APTLY_REPO=https://github.com/aptly-dev/aptly.git
|
ARG APTLY_REPO=https://github.com/smstone/aptly.git
|
||||||
ARG APTLY_REFSPEC=master
|
ARG APTLY_REFSPEC=allow-custom-codename
|
||||||
|
|
||||||
RUN /opt/install_aptly.sh
|
RUN /opt/install_aptly.sh
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ COPY "${APTLY_CONFIG_PATH}" /etc/aptly.conf
|
||||||
COPY tools/install_aptly.sh /opt/install_aptly.sh
|
COPY tools/install_aptly.sh /opt/install_aptly.sh
|
||||||
|
|
||||||
ARG APTLY_INSTALL_FROM=source
|
ARG APTLY_INSTALL_FROM=source
|
||||||
ARG APTLY_REPO=https://github.com/aptly-dev/aptly.git
|
ARG APTLY_REPO=https://github.com/smstone/aptly.git
|
||||||
ARG APTLY_REFSPEC=master
|
ARG APTLY_REFSPEC=allow-custom-codename
|
||||||
|
|
||||||
RUN /opt/install_aptly.sh
|
RUN /opt/install_aptly.sh
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,10 @@ RELEASE_SIGN_KEY_PASSPHRASE=${RELEASE_SIGN_KEY_PASSPHRASE:-""}
|
||||||
|
|
||||||
# APTLY_INSTALL_FROM is either 'apt' or 'source'
|
# APTLY_INSTALL_FROM is either 'apt' or 'source'
|
||||||
APTLY_INSTALL_FROM=${APTLY_INSTALL_FROM:-"source"}
|
APTLY_INSTALL_FROM=${APTLY_INSTALL_FROM:-"source"}
|
||||||
APTLY_REPO=${APTLY_REPO:-"https://github.com/aptly-dev/aptly.git"}
|
# Explicitly setting the codename relies on an unmerged pull request
|
||||||
APTLY_REFSPEC=${APTLY_REFSPEC:-"v1.4.0"}
|
# https://github.com/aptly-dev/aptly/pull/892
|
||||||
|
APTLY_REPO=${APTLY_REPO:-"https://github.com/smstone/aptly.git"}
|
||||||
|
APTLY_REFSPEC=${APTLY_REFSPEC:-"allow-custom-codename"}
|
||||||
|
|
||||||
docker build -f "${IMAGE}"/Dockerfile."${DISTRO}" --network=host \
|
docker build -f "${IMAGE}"/Dockerfile."${DISTRO}" --network=host \
|
||||||
-t "${REGISTRY_URI}""${IMAGE}":"${VERSION}"-"${DISTRO}""${EXTRA_TAG_INFO}" \
|
-t "${REGISTRY_URI}""${IMAGE}":"${VERSION}"-"${DISTRO}""${EXTRA_TAG_INFO}" \
|
||||||
|
|
|
@ -59,6 +59,10 @@ for source_prefix in /opt/sources/*; do
|
||||||
aptly mirror update -config="${conf}" -max-tries=3 "${source}"
|
aptly mirror update -config="${conf}" -max-tries=3 "${source}"
|
||||||
aptly snapshot create -config="${conf}" "${source}" from mirror "${source}"
|
aptly snapshot create -config="${conf}" "${source}" from mirror "${source}"
|
||||||
|
|
||||||
|
# preserve the codename and label of the source repository
|
||||||
|
codename=$(aptly mirror show ${source} | sed -n 's/^Codename: //p')
|
||||||
|
label=$(aptly mirror show ${source} | sed -n 's/^Label: //p')
|
||||||
|
|
||||||
# Publish snapshot and sign if a key passphrase is provided.
|
# Publish snapshot and sign if a key passphrase is provided.
|
||||||
com_list=$(echo "${components[@]}" | tr ' ' ',')
|
com_list=$(echo "${components[@]}" | tr ' ' ',')
|
||||||
if [ ! -z "$1" ]; then
|
if [ ! -z "$1" ]; then
|
||||||
|
@ -67,11 +71,15 @@ for source_prefix in /opt/sources/*; do
|
||||||
-component="${com_list}" \
|
-component="${com_list}" \
|
||||||
-distribution="${dist}" \
|
-distribution="${dist}" \
|
||||||
-passphrase="${1}" \
|
-passphrase="${1}" \
|
||||||
|
-codename="${codename}" \
|
||||||
|
-label="${label}" \
|
||||||
"${source}" "${source_prefix:13}"
|
"${source}" "${source_prefix:13}"
|
||||||
else
|
else
|
||||||
aptly publish snapshot \
|
aptly publish snapshot \
|
||||||
-component="${com_list}" \
|
-component="${com_list}" \
|
||||||
-distribution="${dist}" \
|
-distribution="${dist}" \
|
||||||
|
-codename="${codename}" \
|
||||||
|
-label="${label}" \
|
||||||
"${source}" "${source_prefix:13}"
|
"${source}" "${source_prefix:13}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue