Release --help
This commit is contained in:
parent
29f650fc27
commit
bd99e1bb55
2 changed files with 71 additions and 1 deletions
|
@ -20,7 +20,7 @@ jobs:
|
||||||
#- "ls -lah /tmp/build/"
|
#- "ls -lah /tmp/build/"
|
||||||
#- "ls -lah /tmp/build/logs/"
|
#- "ls -lah /tmp/build/logs/"
|
||||||
#- "ls -lah /tmp/build/packages/"
|
#- "ls -lah /tmp/build/packages/"
|
||||||
- "wget https://github.com/buildkite/github-release/releases/download/v1.0/github-release-linux-amd64 -O /tmp/git-release -q; chmod +x /tmp/git-release;"
|
- "wget https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-linux.gz -O git-release.gz -q && gunzip git-release.gz && chmod +x git-release;"
|
||||||
- >
|
- >
|
||||||
mkdir -p /tmp/build/packages/;
|
mkdir -p /tmp/build/packages/;
|
||||||
echo "XXXX" > /tmp/build/packages/xxxxx;
|
echo "XXXX" > /tmp/build/packages/xxxxx;
|
||||||
|
|
70
scripts/travis_deploy.sh
Executable file
70
scripts/travis_deploy.sh
Executable file
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ -z "${GIT_AUTHTOKEN}" ]]; then
|
||||||
|
echo "Missing environment variable GIT_AUTHTOKEN. Please set it before usign this script!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GIT_COMMIT_SHORT=$(git rev-parse --short HEAD)
|
||||||
|
GIT_COMMIT_LONG=$(git rev-parse HEAD)
|
||||||
|
echo "Deploying $GIT_COMMIT_SHORT ($GIT_COMMIT_LONG) to github."
|
||||||
|
|
||||||
|
cd /tmp/
|
||||||
|
if [[ ! -x git-release ]]; then
|
||||||
|
echo "Downloading github-release-linux (1.2.4)"
|
||||||
|
wget https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-linux.gz -O git-release.gz -q;
|
||||||
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to download github-release-linux"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
gunzip git-release.gz && chmod +x git-release;
|
||||||
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to unzip github-release-linux"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -x git-release ]]; then
|
||||||
|
echo "git-release isn't executable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Download of github-release-linux (1.2.4) finished"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Generating release"
|
||||||
|
./github-release release \
|
||||||
|
--repo "TeaWeb" \
|
||||||
|
--owner "TeaSpeak" \
|
||||||
|
--token "${GIT_AUTHTOKEN}" \
|
||||||
|
--title "Travis autobuild ${GIT_COMMIT_SHORT}" \
|
||||||
|
--tag "${GIT_COMMIT_SHORT}" \
|
||||||
|
--description "This is a autobuild release from travis"
|
||||||
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to generate git release"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Uploading release files"
|
||||||
|
folders=("/tmp/build/logs/" "/tmp/build/packages/")
|
||||||
|
for folder in "${folders[@]}"; do
|
||||||
|
echo "Scanning folder $folder"
|
||||||
|
for file in ${folder}*; do
|
||||||
|
if [[ -d ${file} ]]; then
|
||||||
|
echo " Skipping directory `basename $file` ($file)"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo " Found entry $file. Uploading file.";
|
||||||
|
./github-release upload \
|
||||||
|
--repo "TeaWeb" \
|
||||||
|
--owner "TeaSpeak" \
|
||||||
|
--token "${GIT_AUTHTOKEN}" \
|
||||||
|
--tag "${GIT_COMMIT_SHORT}" \
|
||||||
|
--file "$file" \
|
||||||
|
--name "`basename $file`"
|
||||||
|
|
||||||
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to generate git release"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
done
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue