Skip to content

Commit

Permalink
Remove branch/PR check in deploy script
Browse files Browse the repository at this point in the history
This is now handled by Travis/AppVeyor deployment mechanisms
  • Loading branch information
fniephaus committed Jan 25, 2018
1 parent 8786625 commit 194e494
Showing 1 changed file with 41 additions and 46 deletions.
87 changes: 41 additions & 46 deletions .travis_deploy.sh
@@ -1,58 +1,53 @@
#!/bin/bash
set -e

PR=${TRAVIS_PULL_REQUEST:-${APPVEYOR_PULL_REQUEST_NUMBER:-false}}
BR=${TRAVIS_BRANCH:-${APPVEYOR_REPO_BRANCH}}
"./deploy/generate-artifacts.sh"

if [[ $PR == "false" ]] && ( [[ "$BR" == "Cog" || "$BR" == "master" || true ]] ); then
"./deploy/generate-artifacts.sh"
echo "$(cat .bintray.json | .git_filters/RevDateURL.smudge)" > .bintray.json
sed -i.bak 's/$Rev: \([0-9][0-9]*\) \$/\1/' .bintray.json
sed -i.bak 's/$Date: \(.*\) \$/\1/' .bintray.json
rm -f .bintray.json.bak

echo "$(cat .bintray.json | .git_filters/RevDateURL.smudge)" > .bintray.json
sed -i.bak 's/$Rev: \([0-9][0-9]*\) \$/\1/' .bintray.json
sed -i.bak 's/$Date: \(.*\) \$/\1/' .bintray.json
rm -f .bintray.json.bak

if [[ "${APPVEYOR}" ]]; then
appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem
export SSL_CERT_FILE=cacert.pem
export PATH="C:\\Ruby23\\bin:$PATH"
export CMDSHELL="cmd /C "
fi
$CMDSHELL gem install dpl
$CMDSHELL dpl --provider=bintray --user=timfel --key=$BINTRAYAPIKEY --file=.bintray.json
if [[ "${APPVEYOR}" ]]; then
appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem
export SSL_CERT_FILE=cacert.pem
export PATH="C:\\Ruby23\\bin:$PATH"
export CMDSHELL="cmd /C "
fi
$CMDSHELL gem install dpl
$CMDSHELL dpl --provider=bintray --user=timfel --key=$BINTRAYAPIKEY --file=.bintray.json

# Clean out old versions from bintray, leaving only the last version per month
if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${ARCH}" == "linux64x64" ]] && [[ "${FLAVOR}" == "squeak.cog.spur" ]]; then
ruby -rdate -rnet/http -rjson -e "lastver=DateTime.now;
user='timfel';
pass='${BINTRAYAPIKEY}';
url='https://api.bintray.com/packages/opensmalltalk/vm/cog';
uri=URI(url);
json=nil;
# Clean out old versions from bintray, leaving only the last version per month
if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${ARCH}" == "linux64x64" ]] && [[ "${FLAVOR}" == "squeak.cog.spur" ]]; then
ruby -rdate -rnet/http -rjson -e "lastver=DateTime.now;
user='timfel';
pass='${BINTRAYAPIKEY}';
url='https://api.bintray.com/packages/opensmalltalk/vm/cog';
uri=URI(url);
json=nil;
http=Net::HTTP.new(uri.host,uri.port);
http.use_ssl=true;
http.start {
req=Net::HTTP::Get.new(uri.request_uri);
req.basic_auth(user,pass);
resp=http.request(req);
json=JSON.parse(resp.body)
};
(json['versions'][10..-1] || []).each { |v|
ver=DateTime.parse(v);
if ver.month != lastver.month then
lastver=ver; next
else
lastver=ver
end;
uri=URI(url+'/versions/'+v);
http=Net::HTTP.new(uri.host,uri.port);
http.use_ssl=true;
http.start {
req=Net::HTTP::Get.new(uri.request_uri);
req=Net::HTTP::Delete.new(uri.request_uri);
req.basic_auth(user,pass);
resp=http.request(req);
json=JSON.parse(resp.body)
};
(json['versions'][10..-1] || []).each { |v|
ver=DateTime.parse(v);
if ver.month != lastver.month then
lastver=ver; next
else
lastver=ver
end;
uri=URI(url+'/versions/'+v);
http=Net::HTTP.new(uri.host,uri.port);
http.use_ssl=true;
http.start {
req=Net::HTTP::Delete.new(uri.request_uri);
req.basic_auth(user,pass);
resp=http.request(req);
puts 'Deleted ' + v + ' ' + resp.body
}
}"
fi
puts 'Deleted ' + v + ' ' + resp.body
}
}"
fi

0 comments on commit 194e494

Please sign in to comment.