12
0
2025-05-09 16:39:09 +00:00
committed by Git OBS Bridge
4 changed files with 33 additions and 19 deletions

40
README
View File

@@ -6,22 +6,24 @@ build recipe (.kiwi, Dockerfile, Chart.yaml) to replace placeholders with
build-specific metainfo. In Kiwi builds it processes also the config.sh
script.
| Placeholder | Value | Example |
|--------------------------------------|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| %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 (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/ |
| %RELEASE% | The OBS release number (<cicnt\>.<bldcnt\>) | 4.2 |
| %BUILDTIME% | $(date --utc +%FT%T.%NZ) | 2018-10-30T09:19:02.074934628Z |
| %ARCH% | The architecture of the image | aarch64 |
| %OS_VERSION% | VERSION in the os-release file | 15-SP3 |
| %OS_VERSION_NO_DASH% | VERSION in the os-release file, with space (SLE only) | 15 SP3 |
| %OS_VERSION_ID% | VERSION_ID in the os-release file | 15 |
| %OS_VERSION_ID_SP% | Like VERSION_ID, but with SP (SLE only) | 15.3 |
| %OS_PRETTY_NAME% | PRETTY_NAME in the os-release file | SUSE Linux Enterprise Server 15 SP3 (Snapshot16) |
| %OS_VENDOR% | PRETTY_NAME up to first space character | SUSE |
| %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_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 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 line for the last stage) on the registry | sha256:eb34a30c66b6e1df129bc42d413749466f62e81101c1f8ef04c8fa248e2fe482 |
| Placeholder | Value | Example |
|--------------------------------------|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| %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_WITH(foo.spec)% | Source url for container recipe referencing a file (OBS) | https://build.opensuse.org/public/source/openSUSE:Factory/opensuse-tumbleweed-image/foo.spec?rev=0f40c57dd619e1dff9e512949b6bca09 |
| %SOURCEURL% | Source url for container recipe (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/ |
| %SOURCEURL_WITH(foo.spec)% | Source url for container recipe referencing a file (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/foo.spec |
| %RELEASE% | The OBS release number (<cicnt\>.<bldcnt\>) | 4.2 |
| %BUILDTIME% | $(date --utc +%FT%T.%NZ) | 2018-10-30T09:19:02.074934628Z |
| %ARCH% | The architecture of the image | aarch64 |
| %OS_VERSION% | VERSION in the os-release file | 15-SP3 |
| %OS_VERSION_NO_DASH% | VERSION in the os-release file, with space (SLE only) | 15 SP3 |
| %OS_VERSION_ID% | VERSION_ID in the os-release file | 15 |
| %OS_VERSION_ID_SP% | Like VERSION_ID, but with SP (SLE only) | 15.3 |
| %OS_PRETTY_NAME% | PRETTY_NAME in the os-release file | SUSE Linux Enterprise Server 15 SP3 (Snapshot16) |
| %OS_VENDOR% | PRETTY_NAME up to first space character | SUSE |
| %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_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 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 line for the last stage) on the registry | sha256:eb34a30c66b6e1df129bc42d413749466f62e81101c1f8ef04c8fa248e2fe482 |

View File

@@ -58,8 +58,10 @@ rev=$(echo ${localpath} | cut -d- -f1)
packagename=$(echo ${localpath} | cut -d- -f2- | cut -d: -f1)
if [[ "${DISTURL}" == obs://build.suse.de/* ]]; then
SOURCEURL="https://sources.suse.com/${prj}/${packagename}/${rev}/"
SOURCEURL_PLACEHOLDER="${SOURCEURL}\\1"
else
SOURCEURL="https://$(echo ${DISTURL} | cut -d/ -f3)/package/show/${prj}/${packagename}?rev=${rev}"
SOURCEURL_PLACEHOLDER="https://$(echo ${DISTURL} | cut -d/ -f3)/public/source/${prj}/${packagename}/\\1?rev=${rev}"
fi
# Print all rpm files which contain os-release
@@ -159,6 +161,7 @@ fi
sed -i"" \
-e "s#%DISTURL%#${DISTURL}#g" \
-e "s#%SOURCEURL%#${SOURCEURL}#g" \
-e "s#%SOURCEURL_WITH(\([^)]\+\))%#${SOURCEURL_PLACEHOLDER}#g" \
-e "s/%RELEASE%/${RELEASE}/g" \
-e "s/%ARCH%/${BUILD_ARCH}/g" \
-e "s/%BUILDTIME%/$(date --utc +%FT%T.%NZ)/g" "${files[@]}"

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed May 7 11:39:52 UTC 2025 - Dirk Müller <dmueller@suse.com>
- add %SOURCEURL_WITH% for proper handling of READMEs
-------------------------------------------------------------------
Mon Apr 7 11:54:26 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

View File

@@ -32,6 +32,7 @@ export BUILD_DIST=.dist
cat >Dockerfile <<EOF
DISTURL=%DISTURL%
SOURCEURL=%SOURCEURL%
README=%SOURCEURL_WITH(README.md)%
RELEASE=%RELEASE%
BUILDTIME=%BUILDTIME%
ARCH=%ARCH%
@@ -51,6 +52,7 @@ bash "${script}"
diff -u Dockerfile - <<EOF
DISTURL=obs://build.opensuse.org/openSUSE:Factory/images/0f40c57dd619e1dff9e512949b6bca09-opensuse-tumbleweed-image:docker
SOURCEURL=https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=0f40c57dd619e1dff9e512949b6bca09
README=https://build.opensuse.org/public/source/openSUSE:Factory/opensuse-tumbleweed-image/README.md?rev=0f40c57dd619e1dff9e512949b6bca09
RELEASE=4.2
BUILDTIME=2018-10-30T09:19:02.074934628Z
ARCH=aarch64
@@ -76,6 +78,7 @@ EOF
cat >Dockerfile <<EOF
DISTURL=%DISTURL%
SOURCEURL=%SOURCEURL%
README=%SOURCEURL_WITH(README.md-flavor)%
EOF
bash "${script}"
@@ -83,6 +86,7 @@ bash "${script}"
diff -u Dockerfile - <<EOF
DISTURL=obs://build.suse.de/SUSE:SLE-15-SP3:Update:CR/images/5f0a221b7877396cbf977205e64690d2-sles15-image
SOURCEURL=https://sources.suse.com/SUSE:SLE-15-SP3:Update:CR/sles15-image/5f0a221b7877396cbf977205e64690d2/
README=https://sources.suse.com/SUSE:SLE-15-SP3:Update:CR/sles15-image/5f0a221b7877396cbf977205e64690d2/README.md-flavor
EOF
# Test _multibuild