Browse Source

travis: remove repository deployment

pull/2/head
Alibek Omarov 6 years ago
parent
commit
baefab7e3d
  1. 13
      .travis.yml
  2. 14
      scripts/continious_upload.sh
  3. 89
      scripts/travis-deploy.sh
  4. 5
      scripts/yadisk_clear.sh

13
.travis.yml

@ -13,12 +13,6 @@ jdk: @@ -13,12 +13,6 @@ jdk:
jobs:
include:
- stage: init
name: "Initialize webdav cache"
os: linux
cache: false
script:
- sh scripts/yadisk_clear.sh
- stage: build
name: "Build for Linux & Android"
cache: ccache
@ -91,10 +85,3 @@ jobs: @@ -91,10 +85,3 @@ jobs:
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
after_script:
- sh scripts/continious_upload.sh xash3d-vc.7z xash3d-vc2008-sln.7z
- stage: deploy
name: "Deploy to github repo"
os: linux
cache: false
script:
- sh scripts/travis-deploy.sh Xash3DFWGS-i386.AppImage xash3d-osx.tar.bz2 xash3d-vc.7z xash3d-vc2008-sln.7z # xash3d-mingw.7z

14
scripts/continious_upload.sh

@ -11,17 +11,3 @@ chmod +x upload.sh @@ -11,17 +11,3 @@ chmod +x upload.sh
export GITHUB_TOKEN=$GH_TOKEN
./upload.sh $*
##################################
#
# Yandex.Disk
#
##################################
FOLDER_NAME=$DEPLOY_BRANCH-$TRAVIS_BRANCH
WEBDAV_SRV=https://$YANDEX_DISK_USER:$YANDEX_DISK_TOKEN@webdav.yandex.ru
for file in $*; do
echo "Uploading $file..."
curl -T $file $WEBDAV_SRV/$FOLDER_NAME/$file
done

89
scripts/travis-deploy.sh

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
#!/bin/bash
die()
{
echo $1
exit 1
}
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Travis should not deploy from pull requests"
exit 0
fi
append_readme()
{
for arg in $FILES; do
echo \* [$arg]\(https://github.com/FWGS/xash3d-deploy/blob/$DEPLOY_BRANCH-$TRAVIS_BRANCH/$arg\?raw\=true\) >> README.md
echo >> README.md
done
}
generate_continious_tag()
{
if [ $TRAVIS_BRANCH == "master" ]; then
echo "continuous"
else
echo "continuous-$TRAVIS_BRANCH"
fi
}
generate_readme()
{
TAG=$(generate_continuous_tag)
echo \# Moved to GitHub Releases at [here]\(https://github.com/FWGS/xash3d-fwgs/releases/tag/$TAG\) >> README.md
echo >> README.md
echo >> README.md
echo >> README.md
echo >> README.md
echo \# $TRAVIS_BRANCH branch autobuilds from $DEPLOY_BRANCH >> README.md
echo >> README.md
echo Short changelog: >> README.md
echo \`\`\` >> README.md
(cd $TRAVIS_BUILD_DIR; TZ=UTC git log --pretty=format:'%h %ad %s' --date iso-local -n 10 $REV_RANGE)| cut -d ' ' -f 1-3,5-100 >> README.md
echo \`\`\` >> README.md
echo >> README.md
echo [Code on GitHub]\(https://github.com/FWGS/xash3d-fwgs/tree/$TRAVIS_COMMIT\) >> README.md
echo >> README.md
echo [Full changelog for this build]\(https://github.com/FWGS/xash3d-fwgs/commits/$TRAVIS_COMMIT\) >> README.md
echo >> README.md
append_readme
echo $TRAVIS_COMMIT > commit.txt
}
yadisk_download()
{
FOLDER_NAME=$DEPLOY_BRANCH-$TRAVIS_BRANCH
WEBDAV_SRV=https://$YANDEX_DISK_USER:$YANDEX_DISK_TOKEN@webdav.yandex.ru
for file in $*; do
curl -L $WEBDAV_SRV/$FOLDER_NAME/$file -o $file
done
}
PUSHED_COMMIT=$(curl --fail https://raw.githubusercontent.com/FWGS/xash3d-deploy/$DEPLOY_BRANCH-$TRAVIS_BRANCH/commit.txt)
echo "Pushed commit: $PUSHED_COMMIT"
if [ ! -z "$PUSHED_COMMIT" ]; then
REV_RANGE="HEAD...$PUSHED_COMMIT"
else
REV_RANGE="HEAD"
fi
git config --global user.name FWGS-deployer
git config --global user.email FWGS-deployer@users.noreply.github.com
FILES=$*
# Create new repo with new files
mkdir xash3d-deploy
cd xash3d-deploy
git init
git remote add travis-deploy-public https://FWGS-deployer:${GH_TOKEN}@github.com/FWGS/xash3d-deploy.git
git checkout -b $DEPLOY_BRANCH-$TRAVIS_BRANCH
yadisk_download $FILES
generate_readme
git add .
git commit -m "Latest travis deploy $TRAVIS_COMMIT"
git push -q --force travis-deploy-public $DEPLOY_BRANCH-$TRAVIS_BRANCH >/dev/null 2>/dev/null
exit 0

5
scripts/yadisk_clear.sh

@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
FOLDER_NAME=$DEPLOY_BRANCH-$TRAVIS_BRANCH
WEBDAV_SRV=https://$YANDEX_DISK_USER:$YANDEX_DISK_TOKEN@webdav.yandex.ru
curl -X DELETE $WEBDAV_SRV/$FOLDER_NAME
curl -X MKCOL $WEBDAV_SRV/$FOLDER_NAME
Loading…
Cancel
Save