- Small cleanups:
* Pass --quiet to cpio * Use consistent variable name for REGISTRY_DIGEST * Mention %BASE_*% behaviour for multi-stage builds explicitly OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-kiwi_metainfo_helper?expand=0&rev=41
This commit is contained in:
parent
8e4bb88238
commit
351e333731
6
README
6
README
@ -6,7 +6,7 @@ build recipe (.kiwi, Dockerfile, Chart.yaml) to replace placeholders with
|
|||||||
build-specific metainfo.
|
build-specific metainfo.
|
||||||
|
|
||||||
| Placeholder | Value | Example |
|
| Placeholder | Value | Example |
|
||||||
|--------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
|
|--------------------------------------|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
|
||||||
| %DISTURL% | The OBS dist url | obs://build.opensuse.org/openSUSE:Factory/images/0f40c57dd619e1dff9e512949b6bca09-opensuse-tumbleweed-image |
|
| %DISTURL% | The OBS dist url | obs://build.opensuse.org/openSUSE:Factory/images/0f40c57dd619e1dff9e512949b6bca09-opensuse-tumbleweed-image |
|
||||||
| %SOURCEURL% | Source url for container recipe (OBS) | https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=0f40c57dd619e1dff9e512949b6bca09 |
|
| %SOURCEURL% | Source url for container recipe (OBS) | https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=0f40c57dd619e1dff9e512949b6bca09 |
|
||||||
| %SOURCEURL% | Source url for container recipe (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/ |
|
| %SOURCEURL% | Source url for container recipe (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/ |
|
||||||
@ -22,5 +22,5 @@ build-specific metainfo.
|
|||||||
| %OS_PRETTY_NAME_DASHED% | PRETTY_NAME with dashes in place of spaces | SUSE-Linux-Enterprise-Server-15-SP3-Snapshot-16 |
|
| %OS_PRETTY_NAME_DASHED% | PRETTY_NAME with dashes in place of spaces | SUSE-Linux-Enterprise-Server-15-SP3-Snapshot-16 |
|
||||||
| %OS_PRETTY_NAME_BEFORE_PAREN% | PRETTY_NAME up to the first open parentheses | SUSE Linux Enterprise Server 15 SP3 |
|
| %OS_PRETTY_NAME_BEFORE_PAREN% | PRETTY_NAME up to the first open parentheses | SUSE Linux Enterprise Server 15 SP3 |
|
||||||
| %OS_PRETTY_NAME_BEFORE_PAREN_DASHED% | PRETTY_NAME up to first open paren with dashes | SUSE-Linux-Enterprise-Server-15-SP3 |
|
| %OS_PRETTY_NAME_BEFORE_PAREN_DASHED% | PRETTY_NAME up to first open paren with dashes | SUSE-Linux-Enterprise-Server-15-SP3 |
|
||||||
| %BASE_REFNAME% | The tag of the base container from registry | registry.suse.com/bci/bci-base:15.6 |
|
| %BASE_REFNAME% | The tag of the base container (FROM line for the last stage) on the registry | registry.suse.com/bci/bci-base:15.6 |
|
||||||
| %BASE_DIGEST% | The dist digest of the base container from registry | sha256:eb34a30c66b6e1df129bc42d413749466f62e81101c1f8ef04c8fa248e2fe482 |
|
| %BASE_DIGEST% | The dist digest of the base container (FROM line for the last stage) on the registry | sha256:eb34a30c66b6e1df129bc42d413749466f62e81101c1f8ef04c8fa248e2fe482 |
|
||||||
|
@ -73,7 +73,7 @@ if grep -q "%OS_" ${files[@]}; then
|
|||||||
# Extract the content
|
# Extract the content
|
||||||
tempdir=$(mktemp -d)
|
tempdir=$(mktemp -d)
|
||||||
trap "rm -r ${tempdir}" EXIT
|
trap "rm -r ${tempdir}" EXIT
|
||||||
rpm2cpio "${relpkgs[0]}" | (cd "${tempdir}" && cpio -id)
|
rpm2cpio "${relpkgs[0]}" | (cd "${tempdir}" && cpio -id --quiet)
|
||||||
|
|
||||||
# And source it
|
# And source it
|
||||||
[ -f "${tempdir}/usr/lib/os-release" ] && . "${tempdir}/usr/lib/os-release"
|
[ -f "${tempdir}/usr/lib/os-release" ] && . "${tempdir}/usr/lib/os-release"
|
||||||
@ -128,12 +128,13 @@ if grep -q "%OS_" ${files[@]}; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Export base container REFNAME and DIGEST
|
# Export base container REFNAME and DIGEST
|
||||||
|
# This XML file was generated by OBS and filled with exactly the data we need.
|
||||||
if [ -f containers/annotation ]; then
|
if [ -f containers/annotation ]; then
|
||||||
REGISTRY_REFNAME="$(sed -n 's/.*<registry_refname>\([^<]*\)<.*/\1/p' < containers/annotation)"
|
REGISTRY_REFNAME="$(sed -n 's/.*<registry_refname>\([^<]*\)<.*/\1/p' < containers/annotation)"
|
||||||
REGISTRY_REFDIGEST="$(sed -n 's/.*<registry_digest>\(.*\)<.*/\1/p' < containers/annotation)"
|
REGISTRY_DIGEST="$(sed -n 's/.*<registry_digest>\(.*\)<.*/\1/p' < containers/annotation)"
|
||||||
sed -i"" \
|
sed -i"" \
|
||||||
-e "s#%BASE_REFNAME%#${REGISTRY_REFNAME}#g" \
|
-e "s#%BASE_REFNAME%#${REGISTRY_REFNAME}#g" \
|
||||||
-e "s#%BASE_DIGEST%#${REGISTRY_REFDIGEST}#g" \
|
-e "s#%BASE_DIGEST%#${REGISTRY_DIGEST}#g" \
|
||||||
"${files[@]}"
|
"${files[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 25 09:01:19 UTC 2024 - Fabian Vogt <fvogt@suse.com>
|
||||||
|
|
||||||
|
- Small cleanups:
|
||||||
|
* Pass --quiet to cpio
|
||||||
|
* Use consistent variable name for REGISTRY_DIGEST
|
||||||
|
* Mention %BASE_*% behaviour for multi-stage builds explicitly
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Aug 8 09:23:21 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
Thu Aug 8 09:23:21 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user