diff --git a/README.md b/README.md index d12f6d7..ae7e4d9 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,11 @@ script: ``` Read also [this article](http://www.yegor256.com/2014/06/24/jekyll-github-deploy.html). + +# Building locally +In order to build a package locally run below commands. + +```bash +gem build jgd.gemspec +gem install jgd-.gem +``` \ No newline at end of file diff --git a/bash/deploy.sh b/bash/deploy.sh index 578b3d0..a84c5e1 100755 --- a/bash/deploy.sh +++ b/bash/deploy.sh @@ -23,18 +23,10 @@ cd "${CLONE}" echo -e "\nBuilding Jekyll site:" rm -rf _site -if [ -r ${BUNDLE} ]; then - if [ -r ${DEPLOY_CONFIG} ]; then - bundle exec jekyll build --config _config.yml,${DEPLOY_CONFIG} - else - bundle exec jekyll build - fi +if [ -r ${DEPLOY_CONFIG} ]; then + ${BUNDLE} jekyll build --config _config.yml,${DEPLOY_CONFIG} else - if [ -r ${DEPLOY_CONFIG} ]; then - jekyll build --config _config.yml,${DEPLOY_CONFIG} - else - jekyll build - fi + ${BUNDLE} jekyll build fi if [ ! -e _site ]; then diff --git a/bin/jgd b/bin/jgd index 205a99a..ae7311b 100755 --- a/bin/jgd +++ b/bin/jgd @@ -23,11 +23,11 @@ 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] +bundle = opts[:bundle] ? '"bundle exec"' : '' spec = Gem::Specification.find_by_name('jgd') root = spec.gem_dir script = File.join(root, 'bash/deploy.sh') fail 'deployment failed, see log above' \ - unless system("#{script} #{url} #{branch} #{branch_from} #{config}") + unless system("#{script} #{url} #{branch} #{branch_from} #{config} #{bundle}") diff --git a/build.sh b/build.sh deleted file mode 100755 index 681cfc3..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -gem build jgd.gemspec -gem install jgd-2.0.snapshot.gem