Skip to content

Commit

Permalink
Merge pull request #2550 from reubenmiller/fix-linux-package-rc-compat
Browse files Browse the repository at this point in the history
fix: linux package release candidate compatibility
  • Loading branch information
reubenmiller authored Dec 20, 2023
2 parents 8d646d1 + 6ec5fb3 commit 152fc2c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 29 deletions.
16 changes: 14 additions & 2 deletions ci/build_scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,20 @@ set_version_variables() {
else
APK_VERSION="${GIT_SEMVER//\~/_rc}"
fi
DEB_VERSION="$GIT_SEMVER"
RPM_VERSION="$GIT_SEMVER"

if [[ "$GIT_SEMVER" = *-rc* ]]; then
# Debian expects a tilde as a separator
DEB_VERSION="${GIT_SEMVER//-/\~}"
else
DEB_VERSION="$GIT_SEMVER"
fi

if [[ "$GIT_SEMVER" = *-rc* ]]; then
# RPM expects a tilde as a separator
RPM_VERSION="${GIT_SEMVER//-/\~}"
else
RPM_VERSION="$GIT_SEMVER"
fi
# container tags are quite limited, so replace forbidden characters with '-'
CONTAINER_VERSION="${GIT_SEMVER//[^a-zA-Z0-9_.-]/-}"

Expand Down
42 changes: 21 additions & 21 deletions configuration/package_manifests/virtual/nfpm.tedge-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ overrides:
# slightly different formats
apk:
depends:
- tedge = ${GIT_SEMVER}
- tedge-mapper = ${GIT_SEMVER}
- tedge-agent = ${GIT_SEMVER}
- tedge = ${APK_VERSION}
- tedge-mapper = ${APK_VERSION}
- tedge-agent = ${APK_VERSION}
# Watchdog does not make sense on apk as it does not use systemd
# - tedge-watchdog = ${GIT_SEMVER}
- tedge-apt-plugin = ${GIT_SEMVER}
- c8y-remote-access-plugin = ${GIT_SEMVER}
- c8y-firmware-plugin = ${GIT_SEMVER}
# - tedge-watchdog = ${APK_VERSION}
- tedge-apt-plugin = ${APK_VERSION}
- c8y-remote-access-plugin = ${APK_VERSION}
- c8y-firmware-plugin = ${APK_VERSION}
rpm:
depends:
# FIXME: Work out a better way to reference the full package specific version which includes the release number (-1) suffix
# without having to manually add it
- ca-certificates
- tedge = ${GIT_SEMVER}-1
- tedge-mapper = ${GIT_SEMVER}-1
- tedge-agent = ${GIT_SEMVER}-1
- tedge-watchdog = ${GIT_SEMVER}-1
- tedge = ${RPM_VERSION}-1
- tedge-mapper = ${RPM_VERSION}-1
- tedge-agent = ${RPM_VERSION}-1
- tedge-watchdog = ${RPM_VERSION}-1
# tedge-apt-plugin does not make sense on rpm
# - tedge-apt-plugin = ${GIT_SEMVER}-1
- c8y-remote-access-plugin = ${GIT_SEMVER}-1
- c8y-firmware-plugin = ${GIT_SEMVER}-1
# - tedge-apt-plugin = ${RPM_VERSION}-1
- c8y-remote-access-plugin = ${RPM_VERSION}-1
- c8y-firmware-plugin = ${RPM_VERSION}-1
deb:
depends:
- tedge (= ${GIT_SEMVER})
- tedge-mapper (= ${GIT_SEMVER})
- tedge-agent (= ${GIT_SEMVER})
- tedge-watchdog (= ${GIT_SEMVER})
- tedge-apt-plugin (= ${GIT_SEMVER})
- c8y-remote-access-plugin (= ${GIT_SEMVER})
- c8y-firmware-plugin (= ${GIT_SEMVER})
- tedge (= ${DEB_VERSION})
- tedge-mapper (= ${DEB_VERSION})
- tedge-agent (= ${DEB_VERSION})
- tedge-watchdog (= ${DEB_VERSION})
- tedge-apt-plugin (= ${DEB_VERSION})
- c8y-remote-access-plugin (= ${DEB_VERSION})
- c8y-firmware-plugin (= ${DEB_VERSION})

deb:
fields:
Expand Down
12 changes: 6 additions & 6 deletions configuration/package_manifests/virtual/nfpm.tedge-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ overrides:
# slightly different formats
apk:
depends:
- tedge = ${GIT_SEMVER}
- tedge-mapper = ${GIT_SEMVER}
- tedge = ${APK_VERSION}
- tedge-mapper = ${APK_VERSION}
rpm:
depends:
# FIXME: Work out a better way to reference the full package specific version which includes the release number (-1) suffix
# without having to manually add it
- tedge = ${GIT_SEMVER}-1
- tedge-mapper = ${GIT_SEMVER}-1
- tedge = ${RPM_VERSION}-1
- tedge-mapper = ${RPM_VERSION}-1
deb:
depends:
- tedge (= ${GIT_SEMVER})
- tedge-mapper (= ${GIT_SEMVER})
- tedge (= ${DEB_VERSION})
- tedge-mapper (= ${DEB_VERSION})

deb:
fields:
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set ignore-comments
set dotenv-load

VERSION := `./ci/build_scripts/version.sh 2>/dev/null || exit 0`
# Detect the default target based on the user's CPU arch.
Expand Down

2 comments on commit 152fc2c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
377 1 3 378 99.74 1h2m52.367999999s

Failed Tests

Name Message ⏱️ Duration Suite
Child device firmware update with cache Expected operation (id=8894708) to be SUCCESSFUL, but got: PENDING (failureReason: ) 34.757 s Firmware Operation Child Device

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
378 0 3 378 100 57m55.607s

Please sign in to comment.