Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: push RCs to unstable repo of cloudsmith #3050

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading