From e63f26cbdf12a4f30a60785a2ef5403b609ce6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justinas=20Stankevi=C4=8Dius?= Date: Tue, 26 Jul 2022 15:27:39 +0300 Subject: [PATCH] [v6.2] Fix artifact registration in Releases API for Teleport Connect (#13946) Fix artifact registration for Teleport Connect --- .drone.yml | 337 ++++++++++++++++++++++++++++-------------------- dronegen/tag.go | 15 ++- 2 files changed, 209 insertions(+), 143 deletions(-) diff --git a/.drone.yml b/.drone.yml index 044161a4e58ea..6c592ddbb2515 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1046,20 +1046,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1068,7 +1071,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1193,20 +1196,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit (FedRAMP/FIPS)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit (FedRAMP/FIPS)" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1215,7 +1221,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1343,20 +1349,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit (RHEL/CentOS 6.x compatible)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit (RHEL/CentOS 6.x compatible)" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1365,7 +1374,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1492,20 +1501,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit (RHEL/CentOS 6.x compatible, FedRAMP/FIPS)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit (RHEL/CentOS 6.x compatible, FedRAMP/FIPS)" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1514,7 +1526,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1538,7 +1550,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -1662,20 +1674,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit RPM" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit RPM" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1684,7 +1699,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1713,7 +1728,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -1834,20 +1849,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit RPM (FedRAMP/FIPS)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit RPM (FedRAMP/FIPS)" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -1856,7 +1874,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -1885,7 +1903,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -2000,20 +2018,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit DEB" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit DEB" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2022,7 +2043,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2046,7 +2067,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -2158,20 +2179,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 64-bit DEB (FedRAMP/FIPS)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 64-bit DEB (FedRAMP/FIPS)" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2180,7 +2204,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2305,20 +2329,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 32-bit" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 32-bit" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2327,7 +2354,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2351,7 +2378,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -2475,20 +2502,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 32-bit RPM" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 32-bit RPM" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2497,7 +2527,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2526,7 +2556,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -2641,20 +2671,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux 32-bit DEB" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux 32-bit DEB" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="386" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2663,7 +2696,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2798,20 +2831,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="MacOS Intel" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="MacOS Intel" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -2820,7 +2856,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -2987,20 +3023,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="MacOS Intel .pkg installer" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="MacOS Intel .pkg installer" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3009,7 +3048,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3176,20 +3215,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="MacOS Intel .pkg installer (tsh client only)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="MacOS Intel .pkg installer (tsh client only)" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="darwin" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3198,7 +3240,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3322,20 +3364,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARMv7 (32-bit)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARMv7 (32-bit)" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3344,7 +3389,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3469,20 +3514,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARM64/ARMv8 (64-bit)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARM64/ARMv8 (64-bit)" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3491,7 +3539,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3515,7 +3563,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -3630,20 +3678,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARM64/ARMv8 (64-bit) DEB" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARM64/ARMv8 (64-bit) DEB" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3652,7 +3703,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3676,7 +3727,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -3791,20 +3842,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARMv7 (32-bit) DEB" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARMv7 (32-bit) DEB" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3813,7 +3867,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -3837,7 +3891,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -3961,20 +4015,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARM64/ARMv8 (64-bit) RPM" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARM64/ARMv8 (64-bit) RPM" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -3983,7 +4040,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -4012,7 +4069,7 @@ volumes: ################################################ # Generated using dronegen, do not edit by hand! # Use 'make dronegen' to update. -# Generated at dronegen/tag.go:396 +# Generated at dronegen/tag.go:399 ################################################ kind: pipeline @@ -4136,20 +4193,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Linux ARMv7 (32-bit) RPM" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Linux ARMv7 (32-bit) RPM" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="linux" -F arch="arm" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -4158,7 +4218,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -4287,20 +4347,23 @@ steps: - which curl || apk add --no-cache curl - |- cd "$WORKSPACE_DIR/go/artifacts" - for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do + find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="Windows 64-bit (tsh client only)" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="Windows 64-bit (tsh client only)" -F os="windows" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="windows" -F arch="amd64" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -4309,7 +4372,7 @@ steps: cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%20/g')" done done environment: @@ -5035,6 +5098,6 @@ volumes: name: drone-s3-debrepo-pvc --- kind: signature -hmac: 694de3e13a63fe7ede9d0f10870bf5c684aac03edcad683d99f97326916ab380 +hmac: 0523180f292c3082e14cc878ab2d10e5dd9b650cd2611f2fed30f0246f817219 ... diff --git a/dronegen/tag.go b/dronegen/tag.go index b20e3990fed86..047dd8e539e44 100644 --- a/dronegen/tag.go +++ b/dronegen/tag.go @@ -299,20 +299,23 @@ func tagCreateReleaseAssetCommands(b buildType, packageType string, extraQualifi `CREDENTIALS="--cert $WORKSPACE_DIR/releases.crt --key $WORKSPACE_DIR/releases.key"`, `which curl || apk add --no-cache curl`, fmt.Sprintf(`cd "$WORKSPACE_DIR/go/artifacts" -for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do +find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*' | while read -r file; do # Skip files that are not results of this build # (e.g. tarballs from which OS packages are made) [ -f "$file.sha256" ] || continue name="$(basename "$file" | sed -E 's/(-|_)v?[0-9].*$//')" # extract part before -vX.Y.Z + description="%[1]s" + products="$name" if [ "$name" = "tsh" ]; then - products="teleport teleport-ent"; - else - products="$name" + products="teleport teleport-ent" + elif [ "$name" = "Teleport Connect" ]; then + description="Teleport Connect" + products="teleport teleport-ent" fi shasum="$(cat "$file.sha256" | cut -d ' ' -f 1)" - curl $CREDENTIALS --fail -o /dev/null -F description="%[1]s" -F os="%[2]s" -F arch="%[3]s" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; + curl $CREDENTIALS --fail -o /dev/null -F description="$description" -F os="%[2]s" -F arch="%[3]s" -F "file=@$file" -F "sha256=$shasum" "$RELEASES_HOST/assets"; for product in $products; do status_code=$(curl $CREDENTIALS -o "$WORKSPACE_DIR/curl_out.txt" -w "%%{http_code}" -F "product=$product" -F "version=$VERSION" -F notesMd="# Teleport $VERSION" -F status=draft "$RELEASES_HOST/releases") @@ -321,7 +324,7 @@ for file in $(find . -type f ! -iname '*.sha256' ! -iname '*-unsigned.zip*'); do cat $WORKSPACE_DIR/curl_out.txt exit 1 fi - curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename $file)" + curl $CREDENTIALS --fail -o /dev/null -X PUT "$RELEASES_HOST/releases/$product@$VERSION/assets/$(basename "$file" | sed 's/ /%%20/g')" done done`, b.Description(packageType, extraQualifications...), b.os, b.arch),