Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Nov 18, 2016
2 parents 592e930 + e0bf376 commit a2657b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bash/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ set -o pipefail

URL=$1
BRANCH=$2
BRANCH_FROM=$3
SRC=$(pwd)
TEMP=$(mktemp -d -t jgd-XXX)
trap "rm -rf ${TEMP}" EXIT
CLONE=${TEMP}/clone
COPY=${TEMP}/copy

echo -e "Cloning Github repository:"
git clone "${URL}" "${CLONE}"
git clone -b "${BRANCH_FROM}" "${URL}" "${CLONE}"
cp -R ${CLONE} ${COPY}

cd "${CLONE}"
Expand Down
5 changes: 4 additions & 1 deletion bin/jgd
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ Usage: jgd [options]
EOS
opt :url, 'Github URL', type: String, default: ''
opt :branch, 'Destination branch', type: String, default: 'gh-pages'
opt :branch_from, 'Source branch', type: String, default: 'master'
end

branch = opts[:branch]
branch_from = opts[:branch_from]
fail 'branch can\'t be empty' if branch.empty?
fail 'branch-from can\'t be empty' if branch_from.empty?
url = opts[:url]
url = `git config --get remote.origin.url`.strip if url.empty?

Expand All @@ -22,4 +25,4 @@ root = spec.gem_dir
script = File.join(root, 'bash/deploy.sh')

fail 'deployment failed, see log above' \
unless system("#{script} #{url} #{branch}")
unless system("#{script} #{url} #{branch} #{branch_from}")
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git config user.name "Test"
git commit -am 'initial commit'
cd "${CWD}"

./bash/deploy.sh "${TMP}" gh-pages
./bash/deploy.sh "${TMP}" gh-pages master

cd "${TMP}"
git checkout gh-pages
Expand Down

0 comments on commit a2657b4

Please sign in to comment.