maint: add Travis CI deployment script

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2016-02-18 21:33:06 +01:00
parent ae197c7584
commit dbb5269100
2 changed files with 58 additions and 0 deletions

View File

@ -13,3 +13,15 @@ script:
- ./maint/utils/check-indent.sh
- ./autogen.sh
- ./maint/utils/travis-build.sh
after_success:
- openssl aes-256-cbc -K $encrypted_036881b9e9dd_key -iv $encrypted_036881b9e9dd_iv -in ./maint/utils/deploy-key.enc -out $HOME/.ssh/deploy-key -d
- chmod 600 $HOME/.ssh/deploy-key
- echo "Host github.com" >> $HOME/.ssh/config
- echo " IdentityFile ~/.ssh/deploy-key" >> $HOME/.ssh/config
deploy:
provider: script
script: ./maint/utils/travis-deploy.sh
on:
branch: master

46
maint/utils/travis-deploy.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
#
# Midnight Commander - deployment script for Travis CI
#
# Copyright (C) 2016
# The Free Software Foundation, Inc.
#
# Written by:
# Yury V. Zaytsev <yury@shurup.com>, 2016
#
# This file is part of the Midnight Commander.
#
# The Midnight Commander is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# The Midnight Commander is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -e
set -x
mkdir HTML && cd HTML
echo "source.midnight-commander.org" > CNAME
echo "It works!" > index.html
touch .nojekyll
git init
git config user.name "Travis CI"
git config user.email "travis@midnight-commander.org"
git add .
git commit -m "Deploy to GitHub Pages"
git push --force --quiet git@github.com:MidnightCommander/source.git master:gh-pages > /dev/null 2>&1
exit 0