Skip to content

Commit

Permalink
Merge pull request #3050 from redpanda-data/DEVPROD-2316
Browse files Browse the repository at this point in the history
release: push RCs to unstable repo of cloudsmith
  • Loading branch information
Jeffail authored Dec 2, 2024
2 parents 8b73381 + bfc6674 commit da19e42
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ publishers:
- name: Publish Linux packages to Cloudsmith
ids:
- connect-linux-pkgs
cmd: ./resources/scripts/push_pkg_to_cloudsmith.sh {{ .ArtifactPath }}
cmd: ./resources/scripts/push_pkg_to_cloudsmith.sh {{ .ArtifactPath }} {{ .Version }}
env:
- CLOUDSMITH_API_KEY={{ .Env.CLOUDSMITH_API_KEY }}
26 changes: 24 additions & 2 deletions resources/scripts/push_pkg_to_cloudsmith.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
set -ex

PKG_FILE=$1
PKG_VERSION=$2

if [[ "$PKG_FILE" == "" ]]; then
echo "Usage: $0 <pkg_file>"
echo "Usage: $0 <pkg_file> <pkg_version>"
exit 1
fi

Expand All @@ -25,4 +26,25 @@ else
exit 1
fi

cloudsmith push "$PKG_TYPE" redpanda/redpanda/any-distro/any-version "$PKG_FILE" --republish
if [[ -z $PKG_VERSION ]]; then
echo "Usage: $0 <pkg_file> <pkg_version>"
exit 1
fi

# goreleaser removes `v` in front of the {{.Version}}
# the check for release repos should be agnostic of
# the existence of `v`
if [[ $PKG_VERSION == v* ]]; then
version=$(echo $PKG_VERSION | cut -c2-)
else
version=$PKG_VERSION
fi

GA_VERSION_PATTERN='^\d+\.\d+\.\d+$'
if [[ $version =~ $GA_VERSION_PATTERN ]]; then
repo="redpanda"
else
repo="redpanda-unstable"
fi

cloudsmith push "$PKG_TYPE" redpanda/$repo/any-distro/any-version "$PKG_FILE" --republish

0 comments on commit da19e42

Please sign in to comment.