Skip to content

Commit

Permalink
Update upload-binaries-gocd
Browse files Browse the repository at this point in the history
Fix regex issues.

Signed-off-by: Kris Hicks <khicks@pivotal.io>
  • Loading branch information
Simon Leung authored and pivotal committed Nov 18, 2015
1 parent ef023fd commit 2654a47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ci/scripts/upload-binaries-gocd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
fi

s3_config_file=$(pwd)/../../../../cli-ci/ci/s3cfg
filename_regex="cf-cli(-installer)?([-_0-9a-z]+)?\.([a-z]+)"
filename_regex="cf-cli(-installer)?([-_0-9a-z]+)?(\.[a-z]+)?"

ls release

Expand All @@ -31,7 +31,7 @@ if [ $? -eq 0 ]; then
os_arch="${BASH_REMATCH[2]}"
extension="${BASH_REMATCH[3]}"
if [ -z "${installer}" ]; then # don't upload edge installers
s3cmd --config=$s3_config_file put $f s3://go-cli/master/cf-cli_edge${os_arch}.${extension}
s3cmd --config=$s3_config_file put $f s3://go-cli/master/cf-cli_edge${os_arch}${extension}
fi
done
fi
Expand All @@ -43,16 +43,16 @@ if [ $? -eq 0 ]; then # head is tagged as a release
set -e
echo "Uploading stable" $release_tag "releases"

release_tag=$( echo $match | cut -d'/' -f3 | egrep 'v[0-9]' )
release_tag=$( echo $match | cut -d'/' -f3 | egrep 'v[0-9]' | cut -d'v' -f2 )
for f in $(ls release/cf-cli*);do
[[ $f =~ $filename_regex ]]
installer="${BASH_REMATCH[1]}"
os_arch="${BASH_REMATCH[2]}"
extension="${BASH_REMATCH[3]}"
if [ -z "${installer}" ]; then
s3cmd --config=$s3_config_file put $f s3://go-cli/releases/${release_tag}/cf-cli-installer_${release_tag}${os_arch}.${extension}
if [ -n "${installer}" ]; then
s3cmd --config=$s3_config_file put $f s3://go-cli/releases/${release_tag}/cf-cli_installer_${release_tag}${os_arch}${extension}
else
s3cmd --config=$s3_config_file put $f s3://go-cli/releases/${release_tag}/cf_cli-${release_tag}-${os}-${arch}.${extension}
s3cmd --config=$s3_config_file put $f s3://go-cli/releases/${release_tag}/cf-cli_${release_tag}${os_arch}${extension}
fi
done
fi

0 comments on commit 2654a47

Please sign in to comment.