Skip to content
Commits on Source (2)
......@@ -451,7 +451,7 @@ system_fatal "cat", $lnk;
system_fatal "cat", $buildinfo_file;
foreach my $visualizer (@ARGV) {
system_fatal "curl", "-F", "metadata=\@$lnk", "-F", "buildinfo=\@$buildinfo_file", "$visualizer";
system_fatal "curl", "-fF", "metadata=\@$lnk", "-F", "buildinfo=\@$buildinfo_file", "$visualizer";
}
say STDOUT "everything is okay!";
......
......@@ -4,3 +4,6 @@ build_gpg_realname: "foo bar"
build_gpg_email: "foo@localhost"
main_template_enable: true
http_template_enable: true
rebuilder_publish:
- http://127.0.0.1/new_build
......@@ -16,6 +16,11 @@
- in-toto
- colorama
- name: Write endpoints that collect build data
template:
src: srebuild-endpoints.j2
dest: /etc/srebuild-endpoints
- name: Copy srebuild
copy:
src: ../../../builder/srebuild
......@@ -26,16 +31,10 @@
src: ../../../builder/srebuild-hook
dest: /usr/lib/srebuild-hook
- name: Copy template
template:
src: srebuild-runner.j2
dest: /usr/bin/srebuild-runner
- name: Set permissions
file:
path: "{{ item }}"
mode: 0755
with_items:
- /usr/bin/srebuild
- /usr/bin/srebuild-runner
- /usr/lib/srebuild-hook
{% for endpoint in rebuilder_publish %}
{{ endpoint }}
{% endfor %}
#!/usr/bin/env bash
srebuild $1 {% for host in groups['visualizers'] %} "{{ hostvars[host]['ansible_default_ipv4']['address'] }}" {% endfor %}
......@@ -7,7 +7,7 @@ server {
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_pass http://127.0.0.1:8000;
proxy_redirect off;
proxy_set_header Host $host;
......@@ -15,4 +15,17 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /new_build {
proxy_pass http://127.0.0.1:4000;
proxy_redirect off;
allow 127.0.0.1;
deny all;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
......@@ -40,3 +40,12 @@
- name: Copy nginx config
copy: src=default.conf dest=/etc/nginx/conf.d/default.conf
notify: "(Handler: All OSs) Reload NGINX"
- name: enable systemd services
systemd:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- gunicorn-visualizer
- gunicorn-accumulator
......@@ -5,9 +5,12 @@ import subprocess
def rebuild(buildinfo):
with open('/etc/srebuild-endpoints') as f:
endpoints = filter(None, (x.strip() for x in f))
with tempfile.NamedTemporaryFile() as f:
f.write(buildinfo)
cmd = ['srebuild-runner', f.name]
cmd = ['srebuild', f.name] + endpoints
print('[+] invoking %r' % cmd)
rc = subprocess.call(cmd)
if rc != 0:
......