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

Commit 1d758c5

Browse files
authored
Merge pull request #36 from OSAS/build_env
Build env
2 parents e86d3d7 + b4e78a5 commit 1d758c5

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

files/build_deploy.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,29 @@
5454

5555
builder_info = {
5656
'middleman': {
57+
'build_env': {},
5758
'build_command': ['bundle', 'exec', 'middleman', 'build', '--verbose'],
5859
'build_subdir': 'build',
5960
'deploy_command': ['bundle', 'exec', 'middleman', 'deploy', '--no-build-before']
6061
},
6162
# Duck: we had an incomplete build for Pulp (new post but blog index not updated)
6263
# disabling --incremental mode for now
6364
'jekyll': {
65+
'build_env': {
66+
'JEKYLL_ENV': 'production'
67+
},
6468
'build_command': ['bundle', 'exec', 'jekyll', 'build', '--verbose', '--trace'],
6569
'build_subdir': '_site',
6670
'deploy_command': None
6771
},
6872
'ascii_binder': {
73+
'build_env': {},
6974
'build_command': ['bundle', 'exec', 'asciibinder', 'package', '--site=main', '--log-level=debug'],
7075
'build_subdir': '_package/main',
7176
'deploy_command': None
7277
},
7378
'planet': {
79+
'build_env': {},
7480
'build_command': ['/srv/builder/planet-venus/planet.py', '-v', 'planet.ini'],
7581
'build_subdir': 'build',
7682
'deploy_command': None
@@ -107,7 +113,7 @@ def get_last_commit(checkout_dir):
107113
os.chdir(checkout_dir)
108114
try:
109115
r = subprocess.check_output(['git', 'ls-remote', '-q', '.',
110-
'refs/remotes/origin/HEAD'])
116+
'refs/remotes/origin/%s' % config['git_version']])
111117
except subprocess.CalledProcessError, C:
112118
notify_error('setup', C.output)
113119
return r.split()[0]
@@ -335,6 +341,10 @@ def do_rsync(source):
335341
pass
336342
notify_error('install', C.output)
337343

344+
# set environment
345+
for env_name, env_value in builder_info[config['builder']]['build_env'].items():
346+
os.environ[env_name] = env_value
347+
338348
try:
339349
command = builder_info[config['builder']]['build_command']
340350
syslog.syslog("Build of {}: {}".format(name, ' '.join(command)))

tasks/schedule_build_and_sync.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
---
22

3+
- name: "Install cron"
4+
package:
5+
name: cronie
6+
state: present
7+
8+
- name: "Start cron service"
9+
service:
10+
name: crond
11+
state: started
12+
313
- name: Add cron to build {{ builder_name }}
414
cron:
515
name: "build and deploy {{ builder_name }}"

templates/builder.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: {{ builder_name }}
33
builder: {{ builder }}
4+
git_version: {{ git_version | default( 'HEAD' ) }}
45
notification:
56
{% if irc_server %}
67
irc:

vars/Debian.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package_list:
2121
- libxml2-dev
2222
- libxslt1-dev
2323
- libidn11-dev
24+
- nodejs
2425
middleman: []
2526
jekyll: []
2627
ascii_binder: []

vars/RedHat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package_list:
2323
- libxml2-devel
2424
- libxslt-devel
2525
- libidn-devel
26+
- nodejs
2627
middleman: []
2728
jekyll: []
2829
ascii_binder: []

0 commit comments

Comments
 (0)