Updated travis and added a helper script
This commit is contained in:
parent
bd99e1bb55
commit
daf1b03fc2
2 changed files with 40 additions and 33 deletions
15
.travis.yml
15
.travis.yml
|
@ -20,21 +20,8 @@ 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/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;
|
||||||
export GIT_TAG=$(git rev-parse HEAD);
|
./scripts/travis_deploy.sh
|
||||||
export GIT_TAG_SHORT=$(git rev-parse --short HEAD);
|
|
||||||
echo "Release commit: $GIT_TAG ($GIT_TAG_SHORT)";
|
|
||||||
|
|
||||||
export GITHUB_RELEASE_TAG="This is a auto build release from travis";
|
|
||||||
export GITHUB_RELEASE_REPOSITORY="TeaSpeak/TeaWeb";
|
|
||||||
export GITHUB_RELEASE_ACCESS_TOKEN="$GIT_AUTHTOKEN";
|
|
||||||
export GITHUB_RELEASE_COMMIT="3dbcad0";
|
|
||||||
/tmp/git-release "Travis autobuild $GIT_TAG_SHORT" /tmp/build/packages/xxxxx \
|
|
||||||
--commit "3dbcad0" \
|
|
||||||
--tag "12312123" \
|
|
||||||
--github-access-token "$GIT_AUTHTOKEN" \
|
|
||||||
--github-repository "TeaSpeak/TeaWeb";
|
|
||||||
if: branch = master
|
if: branch = master
|
|
@ -9,30 +9,39 @@ GIT_COMMIT_SHORT=$(git rev-parse --short HEAD)
|
||||||
GIT_COMMIT_LONG=$(git rev-parse HEAD)
|
GIT_COMMIT_LONG=$(git rev-parse HEAD)
|
||||||
echo "Deploying $GIT_COMMIT_SHORT ($GIT_COMMIT_LONG) to github."
|
echo "Deploying $GIT_COMMIT_SHORT ($GIT_COMMIT_LONG) to github."
|
||||||
|
|
||||||
cd /tmp/
|
GIT_RELEASE_EXECUTABLE="/tmp/git-release"
|
||||||
if [[ ! -x git-release ]]; then
|
if [[ ! -x ${GIT_RELEASE_EXECUTABLE} ]]; then
|
||||||
echo "Downloading github-release-linux (1.2.4)"
|
if [[ ! -f ${GIT_RELEASE_EXECUTABLE} ]]; then
|
||||||
wget https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-linux.gz -O git-release.gz -q;
|
echo "Downloading github-release-linux (1.2.4)"
|
||||||
[[ $? -eq 0 ]] || {
|
|
||||||
echo "Failed to download github-release-linux"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
gunzip git-release.gz && chmod +x git-release;
|
if [[ -f /tmp/git-release.gz ]]; then
|
||||||
[[ $? -eq 0 ]] || {
|
rm /tmp/git-release.gz
|
||||||
echo "Failed to unzip github-release-linux"
|
fi
|
||||||
exit 1
|
wget https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-linux.gz -O /tmp/git-release.gz -q;
|
||||||
}
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to download github-release-linux"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
if [[ ! -x git-release ]]; then
|
gunzip /tmp/git-release.gz && chmod +x /tmp/git-release;
|
||||||
|
[[ $? -eq 0 ]] || {
|
||||||
|
echo "Failed to unzip github-release-linux"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Download of github-release-linux (1.2.4) finished"
|
||||||
|
else
|
||||||
|
chmod +x ${GIT_RELEASE_EXECUTABLE}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -x ${GIT_RELEASE_EXECUTABLE} ]]; then
|
||||||
echo "git-release isn't executable"
|
echo "git-release isn't executable"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Download of github-release-linux (1.2.4) finished"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Generating release"
|
echo "Generating release"
|
||||||
./github-release release \
|
${GIT_RELEASE_EXECUTABLE} release \
|
||||||
--repo "TeaWeb" \
|
--repo "TeaWeb" \
|
||||||
--owner "TeaSpeak" \
|
--owner "TeaSpeak" \
|
||||||
--token "${GIT_AUTHTOKEN}" \
|
--token "${GIT_AUTHTOKEN}" \
|
||||||
|
@ -46,15 +55,22 @@ echo "Generating release"
|
||||||
|
|
||||||
echo "Uploading release files"
|
echo "Uploading release files"
|
||||||
folders=("/tmp/build/logs/" "/tmp/build/packages/")
|
folders=("/tmp/build/logs/" "/tmp/build/packages/")
|
||||||
|
uploaded_files=()
|
||||||
|
|
||||||
for folder in "${folders[@]}"; do
|
for folder in "${folders[@]}"; do
|
||||||
echo "Scanning folder $folder"
|
echo "Scanning folder $folder"
|
||||||
|
if [[ ! -d ${folder} ]]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
for file in ${folder}*; do
|
for file in ${folder}*; do
|
||||||
if [[ -d ${file} ]]; then
|
if [[ -d ${file} ]]; then
|
||||||
echo " Skipping directory `basename $file` ($file)"
|
echo " Skipping directory `basename $file` ($file)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo " Found entry $file. Uploading file.";
|
echo " Found entry `basename $file` ($file). Uploading file.";
|
||||||
./github-release upload \
|
|
||||||
|
${GIT_RELEASE_EXECUTABLE} upload \
|
||||||
--repo "TeaWeb" \
|
--repo "TeaWeb" \
|
||||||
--owner "TeaSpeak" \
|
--owner "TeaSpeak" \
|
||||||
--token "${GIT_AUTHTOKEN}" \
|
--token "${GIT_AUTHTOKEN}" \
|
||||||
|
@ -66,5 +82,9 @@ for folder in "${folders[@]}"; do
|
||||||
echo "Failed to generate git release"
|
echo "Failed to generate git release"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uploaded_files+="$file"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Successfully uploaded ${#uploaded_files[@]} files."
|
Loading…
Add table
Reference in a new issue