Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
building on PR #3 to get a simple multi-builder solution for now
Browse files Browse the repository at this point in the history
  • Loading branch information
duck-rh committed May 19, 2017
1 parent 055d1d0 commit c66a423
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# the username that will run the middleman builder
# # user will be created along a pair of ssh key
builder_username: middleman_builder
builder: 'middleman'
update_submodules: True
watchers: []
irc_server: False
Expand Down
15 changes: 12 additions & 3 deletions files/build_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
args = parser.parse_args()


builder_commands = {
'middleman': {
'build': ['bundle', 'exec', 'middleman' 'build', '--verbose']
}
'jekyll': {
'build': ['bundle', 'exec', 'jekyll', 'build', '--incremental', '--verbose', '--trace']
}
}

def debug_print(message):
if args.debug:
print message
Expand Down Expand Up @@ -206,9 +215,9 @@ def notify_error(stage, error):
notify_error('install', C.output)

try:
syslog.syslog("Build of {}: bundle exec middleman build".format(name))
result = subprocess.check_output(['bundle', 'exec', 'middleman',
'build', '--verbose'])
command = builder_commands[config['builder']]['build']
syslog.syslog("Build of {}: {}".format(name, ' '.join(command)))
result = subprocess.check_output(command)
except subprocess.CalledProcessError, C:
notify_error('build', C.output)

Expand Down
1 change: 1 addition & 0 deletions templates/builder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: {{ name }}
builder: {{ builder }}
notification:
{% if irc_server %}
irc:
Expand Down

0 comments on commit c66a423

Please sign in to comment.