BloodHound/deploy.sh

35 lines
2.4 KiB
Bash
Raw Normal View History

2016-09-02 01:16:27 +00:00
#!/usr/bin/env bash
2016-09-09 03:09:55 +00:00
# DO NOT RUN THIS SCRIPT, THIS IS A SCRIPT FOR TRAVIS TO DO STUFF
2017-03-01 04:48:52 +00:00
response="$(curl -s --user "${GH_USER}" https://api.github.com/repos/BloodHoundAD/BloodHound/releases/4033842/assets)"
2016-09-02 01:16:27 +00:00
iad32id="$(echo "$response" | grep -B 2 \"BloodHound-linux-ia32 | head -n1 | cut -d ":" -f 2 | cut -c 2- | sed 's/.$//')"
x64id="$(echo "$response" | grep -B 2 \"BloodHound-linux-x64 | head -n1 | cut -d ":" -f 2 | cut -c 2- | sed 's/.$//')"
armv7lid="$(echo "$response" | grep -B 2 \"BloodHound-linux-armv7l | head -n1 | cut -d ":" -f 2 | cut -c 2- | sed 's/.$//')"
macid="$(echo "$response" | grep -B 2 \"BloodHound-darwin-x64 | head -n1 | cut -d ":" -f 2 | cut -c 2- | sed 's/.$//')"
2016-09-02 01:16:27 +00:00
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
2016-10-11 18:34:35 +00:00
if [[ ! $iad32id == "" ]]; then
2017-03-01 04:23:04 +00:00
curl -s -X DELETE --user "${GH_USER}" https://api.github.com/repos/BloodHoundAD/BloodHound/releases/assets/$iad32id
2016-09-02 01:16:27 +00:00
fi
if [[ ! $x64id == "" ]]; then
2017-03-01 04:23:04 +00:00
curl -s -X DELETE --user "${GH_USER}" https://api.github.com/repos/BloodHoundAD/BloodHound/releases/assets/$x64id
2016-09-02 01:16:27 +00:00
fi
if [[ ! $armv7lid == "" ]]; then
2017-03-01 04:23:04 +00:00
curl -s -X DELETE --user "${GH_USER}" https://api.github.com/repos/BloodHoundAD/BloodHound/releases/assets/$armv7lid
2016-10-11 18:34:35 +00:00
fi
2017-03-01 04:48:52 +00:00
curl -X POST -# --header 'Content-Type:application/zip' --data-binary @BloodHound-linux-ia32-$TRAVIS_COMMIT.zip --user "${GH_USER}" https://uploads.github.com/repos/BloodHoundAD/BloodHound/releases/4033842/assets?name=BloodHound-linux-ia32-$TRAVIS_COMMIT.zip
curl -X POST -# --header 'Content-Type:application/zip' --data-binary @BloodHound-linux-x64-$TRAVIS_COMMIT.zip --user "${GH_USER}" https://uploads.github.com/repos/BloodHoundAD/BloodHound/releases/4033842/assets?name=BloodHound-linux-x64-$TRAVIS_COMMIT.zip
curl -X POST -# --header 'Content-Type:application/zip' --data-binary @BloodHound-linux-armv7l-$TRAVIS_COMMIT.zip --user "${GH_USER}" https://uploads.github.com/repos/BloodHoundAD/BloodHound/releases/4033842/assets?name=BloodHound-linux-armv7l-$TRAVIS_COMMIT.zip
2016-09-02 01:16:27 +00:00
fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ ! $macid == "" ]]; then
2017-03-01 04:23:04 +00:00
curl -s -X DELETE --user "${GH_USER}" https://api.github.com/repos/BloodHoundAD/BloodHound/releases/assets/$macid
2016-09-02 01:16:27 +00:00
fi
2017-03-01 04:48:52 +00:00
curl -X POST -# --header 'Content-Type:application/zip' --data-binary @BloodHound-darwin-x64-$TRAVIS_COMMIT.zip --user "${GH_USER}" https://uploads.github.com/repos/BloodHoundAD/BloodHound/releases/4033842/assets?name=BloodHound-darwin-x64-$TRAVIS_COMMIT.zip
2016-09-02 01:16:27 +00:00
fi