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

Commit bb7ae86

Browse files
committed
building on PR #3 to get a simple multi-builder solution for now
1 parent 055d1d0 commit bb7ae86

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# the username that will run the middleman builder
22
# # user will be created along a pair of ssh key
33
builder_username: middleman_builder
4+
builder: 'middleman'
45
update_submodules: True
56
watchers: []
67
irc_server: False

files/build_deploy.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
args = parser.parse_args()
5050

5151

52+
builder_commands = {
53+
'middleman': {
54+
'build': ['bundle', 'exec', 'middleman' 'build', '--verbose']
55+
},
56+
'jekyll': {
57+
'build': ['bundle', 'exec', 'jekyll', 'build', '--incremental', '--verbose', '--trace']
58+
}
59+
}
60+
5261
def debug_print(message):
5362
if args.debug:
5463
print message
@@ -206,9 +215,9 @@ def notify_error(stage, error):
206215
notify_error('install', C.output)
207216

208217
try:
209-
syslog.syslog("Build of {}: bundle exec middleman build".format(name))
210-
result = subprocess.check_output(['bundle', 'exec', 'middleman',
211-
'build', '--verbose'])
218+
command = builder_commands[config['builder']]['build']
219+
syslog.syslog("Build of {}: {}".format(name, ' '.join(command)))
220+
result = subprocess.check_output(command)
212221
except subprocess.CalledProcessError, C:
213222
notify_error('build', C.output)
214223

templates/builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: {{ name }}
2+
builder: {{ builder }}
23
notification:
34
{% if irc_server %}
45
irc:

0 commit comments

Comments
 (0)