Skip to content

Commit

Permalink
Use bundle to execute commands
Browse files Browse the repository at this point in the history
  • Loading branch information
darekmydlarz committed Jul 5, 2017
1 parent 1c754f4 commit fd510aa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bash/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ URL=$1
BRANCH=$2
BRANCH_FROM=$3
DEPLOY_CONFIG=$4
BUNDLE=$5
SRC=$(pwd)
TEMP=$(mktemp -d -t jgd-XXX)
trap "rm -rf ${TEMP}" EXIT
Expand All @@ -22,10 +23,18 @@ cd "${CLONE}"
echo -e "\nBuilding Jekyll site:"
rm -rf _site

if [ -r ${DEPLOY_CONFIG} ]; then
jekyll build --config _config.yml,${DEPLOY_CONFIG}
if [ -r ${BUNDLE} ]; then
if [ -r ${DEPLOY_CONFIG} ]; then
bundle exec jekyll build --config _config.yml,${DEPLOY_CONFIG}
else
bundle exec jekyll build
fi
else
jekyll build
if [ -r ${DEPLOY_CONFIG} ]; then
jekyll build --config _config.yml,${DEPLOY_CONFIG}
else
jekyll build
fi
fi

if [ ! -e _site ]; then
Expand Down
2 changes: 2 additions & 0 deletions bin/jgd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Usage: jgd [options]
opt :branch, 'Destination branch', type: String, default: 'gh-pages'
opt :branch_from, 'Source branch', type: String, default: 'master'
opt :config, 'Deploy Config File', type: String, default: '_config-deploy.yml'
opt :bundle, 'Use bundle'
end

branch = opts[:branch]
Expand All @@ -22,6 +23,7 @@ fail 'branch-from can\'t be empty' if branch_from.empty?
fail 'config can\'t be empty' if config.empty?
url = opts[:url]
url = `git config --get remote.origin.url`.strip if url.empty?
bundle = opts[:bundle]

spec = Gem::Specification.find_by_name('jgd')
root = spec.gem_dir
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
gem build jgd.gemspec
gem install jgd-2.0.snapshot.gem

0 comments on commit fd510aa

Please sign in to comment.