buildmaster: add support for task artifacts for dev
This commit is contained in:
parent
965904e542
commit
b445832e93
6 changed files with 40 additions and 1 deletions
|
@ -35,3 +35,4 @@ fakefedorainfra_endpoint: fakefedorainfra
|
|||
fakefedorainfra_url: https://taskotron-dev.fedoraproject.org/fakefedorainfra
|
||||
taskotron_docs_url: https://docs.qadevel.cloud.fedoraproject.org/libtaskotron/latest/
|
||||
freezes: false
|
||||
public_artifacts_dir: /srv/taskotron/artifacts
|
||||
|
|
|
@ -26,3 +26,4 @@ landingpage_title: "Taskotron"
|
|||
deployment_type: prod
|
||||
tcp_ports: [ 80, 443, "{{ buildslave_port }}" ]
|
||||
taskotron_docs_url: https://docs.qadevel.cloud.fedoraproject.org/libtaskotron/latest/
|
||||
public_artifacts_dir: /srv/taskotron/artifacts
|
||||
|
|
|
@ -31,3 +31,4 @@ fakefedorainfra_endpoint: fakefedorainfra
|
|||
fakefedorainfra_url: https://taskotron.stg.fedoraproject.org/fakefedorainfra
|
||||
taskotron_docs_url: https://docs.qadevel.cloud.fedoraproject.org/libtaskotron/latest/
|
||||
freezes: false
|
||||
public_artifacts_dir: /srv/taskotron/artifacts
|
||||
|
|
|
@ -142,6 +142,7 @@ from buildbot.steps.source.git import Git
|
|||
from buildbot.steps.shell import ShellCommand
|
||||
from buildbot.process.properties import Property, Interpolate
|
||||
from buildbot.steps.slave import RemoveDirectory
|
||||
from buildbot.steps.transfer import DirectoryUpload, FileUpload
|
||||
|
||||
factory = BuildFactory()
|
||||
|
||||
|
@ -161,15 +162,31 @@ factory.addStep(ShellCommand(command=["runtask", '-i',
|
|||
Interpolate('%(prop:item_type)s'),
|
||||
'-a', Interpolate('%(prop:arch)s'),
|
||||
'-j', Interpolate('%(prop:buildername)s/%(prop:buildnumber)s'),
|
||||
{% if deployment_type == 'dev' %}
|
||||
'--uuid', Interpolate('%(prop:uuid)s'),
|
||||
{% endif %}
|
||||
Interpolate('%(prop:taskname)s.yml')],
|
||||
descriptionDone=[Interpolate('%(prop:taskname)s on %(prop:item)s')],
|
||||
name='runtask',
|
||||
logfiles={'taskotron.log': {'filename': '/var/log/taskotron/taskotron.log', }}))
|
||||
|
||||
|
||||
{% if deployment_type == 'dev' %}
|
||||
# create artifacts task_output directory
|
||||
factory.addStep(ShellCommand(command=['mkdir', '-p', '{{ public_artifacts_dir }}/%(prop:uuid)s/task_output']))
|
||||
|
||||
# copy artifacts to master
|
||||
factory.addStep(DirectoryUpload(slavesrc=Interpolate('/var/lib/taskotron/artifacts/%(prop:uuid)s/'),
|
||||
masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/task_output')))
|
||||
|
||||
# copy taskotron log to master
|
||||
factory.addStep(FileUpload(slavesrc="/var/log/taskotron/taskotron.log",
|
||||
masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/taskotron.log')))
|
||||
{% else %}
|
||||
# capture the taskotron log
|
||||
factory.addStep(ShellCommand(command=["cat", "/var/log/taskotron/taskotron.log"], name="cat_log",
|
||||
descriptionDone=['Store log']))
|
||||
|
||||
{% endif %}
|
||||
|
||||
####### RESOURCE LOCKS
|
||||
#
|
||||
|
|
|
@ -23,6 +23,19 @@
|
|||
notify:
|
||||
- restart httpd
|
||||
|
||||
- name: copy artifacts httpd config
|
||||
when: deployment_type == 'dev'
|
||||
template: src=artifacts.conf.j2 dest=/etc/httpd/conf.d/artifacts.conf owner=root group=root
|
||||
notify:
|
||||
- restart httpd
|
||||
|
||||
- name: create artifacts directory
|
||||
when: deployment_type == 'dev'
|
||||
file: path={{ item }} state=directory owner=buildmaster group=buildmaster mode=0775 setype=httpd_sys_content_t
|
||||
with_items:
|
||||
- /srv/taskotron
|
||||
- /srv/taskotron/artifacts
|
||||
|
||||
- name: ensure buildmaster database is created
|
||||
when: buildmaster_db_host != 'localhost'
|
||||
delegate_to: "{{ buildmaster_db_host }}"
|
||||
|
|
6
roles/taskotron/buildmaster/templates/artifacts.conf.j2
Normal file
6
roles/taskotron/buildmaster/templates/artifacts.conf.j2
Normal file
|
@ -0,0 +1,6 @@
|
|||
Alias /artifacts /srv/taskotron/artifacts
|
||||
<Directory "/srv/taskotron/artifacts">
|
||||
Options +Indexes
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
Loading…
Add table
Add a link
Reference in a new issue