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

Fixup for new release artifact structure #2

Open
wants to merge 1 commit into
base: master
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
9 changes: 6 additions & 3 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ install_kubeseal() {
echo "Cleaning previous binaries"
rm -f $binary_path 2>/dev/null || true

echo "Copying binary"
cp "${tmp_download_dir}/kubeseal-${platform}" ${binary_path}
echo "Unpacking and copying binary"
tar xz -C ${bin_install_path} -f $download_path kubeseal
chmod +x ${binary_path}

echo "Cleaning up temp files"
rm -rf $tmp_download_dir
}

get_filename() {
local platform="$2"

echo "kubeseal-${platform}"
echo "kubeseal-${version}-${platform}.tar.gz"
}

get_download_url() {
Expand Down
8 changes: 1 addition & 7 deletions bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ if [ -n "$GITHUB_API_TOKEN" ]; then
fi
cmd="$cmd $releases_path"

# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942
function sort_versions() {
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | \
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
}

# Fetch all tag names, and get only second column. Then remove all unnecesary characters.
versions=$(eval $cmd | grep -oE "tag_name\": *\".{1,15}\"," | sed 's/tag_name\": *\"v//;s/\",//' | sort_versions)
versions=$(eval $cmd | grep 'tag_name":' | sed -e 's/^ *"tag_name": "//' | grep -v ^helm- | grep -v ^sealed | sed -e 's/^v//;s/", *$//' | sort -V)
echo $versions