Skip to content

Commit

Permalink
remove code duplication & move run to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
darekmydlarz committed Jul 12, 2017
1 parent fd510aa commit fae2610
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<version>.gem
```
14 changes: 3 additions & 11 deletions bash/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bin/jgd
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
3 changes: 0 additions & 3 deletions build.sh

This file was deleted.

0 comments on commit fae2610

Please sign in to comment.