gh-pages-travis 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/gh-pages-travis +6 -0
- data/bin/gh-pages-travis.sh +73 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1808ea91fe5c718d7a91d1c7ec1c85b18e34fc91
|
4
|
+
data.tar.gz: ead67bdd223056da5c89f807678d025f9f0d8aa7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7a837b5d2699ff5b1718d4fc0a25442ef43e4177bb30ecab6e29e3d13057aa3eef4815bcf00d96bfc0b37f55464e756444fa74aeb5fd4e084e647316230145bd
|
7
|
+
data.tar.gz: 1057be953d107b4fc81f703c6b08d71dabf53afeec5c699355e60d40e1f8993ff4d263c439d6fe1e79c68930e200eef211975bc96837f2cf249fe16e5445e972
|
data/bin/gh-pages-travis
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -e
|
3
|
+
|
4
|
+
# Deploy built docs from this branch
|
5
|
+
: ${DEPLOY_BRANCH:=master}
|
6
|
+
|
7
|
+
# Deploy built docs from this directory
|
8
|
+
: ${SOURCE_DIR:=doc}
|
9
|
+
|
10
|
+
# Deploy built docs to this branch
|
11
|
+
: ${TARGET_BRANCH:=gh-pages}
|
12
|
+
|
13
|
+
# Use this SSH key to push to github
|
14
|
+
: ${SSH_KEY:=id_rsa}
|
15
|
+
|
16
|
+
# Use this git user name in commits
|
17
|
+
: ${GIT_NAME:=travis}
|
18
|
+
|
19
|
+
# Use this git user email in commits
|
20
|
+
: ${GIT_EMAIL:=deploy@travis-ci.org}
|
21
|
+
|
22
|
+
if [ ! -d "$SOURCE_DIR" ]; then
|
23
|
+
echo "SOURCE_DIR ($SOURCE_DIR) does not exist, build the source directory before deploying"
|
24
|
+
exit 1
|
25
|
+
fi
|
26
|
+
|
27
|
+
REPO=$(git config remote.origin.url)
|
28
|
+
|
29
|
+
if [ -n "$TRAVIS_BUILD_ID" ]; then
|
30
|
+
# When running on Travis we need to use SSH to deploy to GitHub
|
31
|
+
#
|
32
|
+
# The following converts the repo URL to an SSH location,
|
33
|
+
# adds the SSH key and sets up the Git config with
|
34
|
+
# the correct user name and email (globally as this is a
|
35
|
+
# temporary travis environment)
|
36
|
+
#
|
37
|
+
echo DEPLOY_BRANCH: $DEPLOY_BRANCH
|
38
|
+
echo SOURCE_DIR: $SOURCE_DIR
|
39
|
+
echo TARGET_BRANCH: $TARGET_BRANCH
|
40
|
+
echo SSH_KEY: $SSH_KEY
|
41
|
+
echo GIT_NAME: $GIT_NAME
|
42
|
+
echo GIT_EMAIL: $GIT_EMAIL
|
43
|
+
if [ "$TRAVIS_BRANCH" != "$DEPLOY_BRANCH" ]; then
|
44
|
+
echo "Travis should only deploy from the DEPLOY_BRANCH ($DEPLOY_BRANCH) branch"
|
45
|
+
exit 0
|
46
|
+
else
|
47
|
+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
48
|
+
echo "Travis should not deploy from pull requests"
|
49
|
+
exit 0
|
50
|
+
else
|
51
|
+
# switch both git and https protocols as we don't know which travis
|
52
|
+
# is using today (it changed!)
|
53
|
+
REPO=${REPO/git:\/\/github.com\//git@github.com:}
|
54
|
+
REPO=${REPO/https:\/\/github.com\//git@github.com:}
|
55
|
+
|
56
|
+
chmod 600 $SSH_KEY
|
57
|
+
eval `ssh-agent -s`
|
58
|
+
ssh-add $SSH_KEY
|
59
|
+
git config --global user.name "$GIT_NAME"
|
60
|
+
git config --global user.email "$GIT_EMAIL"
|
61
|
+
fi
|
62
|
+
fi
|
63
|
+
fi
|
64
|
+
|
65
|
+
REPO_NAME=$(basename $REPO)
|
66
|
+
TARGET_DIR=$(mktemp -d /tmp/$REPO_NAME.XXXX)
|
67
|
+
REV=$(git rev-parse HEAD)
|
68
|
+
git clone --branch ${TARGET_BRANCH} ${REPO} ${TARGET_DIR}
|
69
|
+
rsync -rt --delete --exclude=".git" --exclude=".travis.yml" $SOURCE_DIR/ $TARGET_DIR/
|
70
|
+
cd $TARGET_DIR
|
71
|
+
git add -A .
|
72
|
+
git commit --allow-empty -m "Built from commit $REV"
|
73
|
+
git push $REPO $TARGET_BRANCH
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gh-pages-travis
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Halliday <pghalliday@gmail.com>
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: CLI to deploy a folder to gh-pages branch of current repo as part of
|
14
|
+
travis build
|
15
|
+
email:
|
16
|
+
executables:
|
17
|
+
- gh-pages-travis
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- bin/gh-pages-travis
|
22
|
+
- bin/gh-pages-travis.sh
|
23
|
+
homepage: https://github.com/pghalliday/gh-pages-travis
|
24
|
+
licenses:
|
25
|
+
- ISC
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.5.1
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: CLI to deploy a folder to gh-pages branch of current repo as part of travis
|
47
|
+
build
|
48
|
+
test_files: []
|