diff --git a/roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2 b/roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2 index 22176be89d..9c5b8af076 100644 --- a/roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2 +++ b/roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2 @@ -244,12 +244,22 @@ factory.addStep(MasterShellCommand(command=["mkdir", '-m', '0755', Interpolate(' descriptionDone=['Create artifacs dir'])) # copy artifacts to master +{% if deployment_type in ['dev'] %} +factory.addStep(DirectoryUpload(slavesrc=Interpolate('/var/lib/taskotron/artifacts/%(prop:uuid)s/'), + masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/'))) +{% else %} factory.addStep(DirectoryUpload(slavesrc=Interpolate('/var/lib/taskotron/artifacts/%(prop:uuid)s/'), masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/task_output'))) +{% endif %} # gzip artifacts +{% if deployment_type in ['dev'] %} +factory.addStep(MasterShellCommand(command=Interpolate('find {{ public_artifacts_dir }}/%(prop:uuid)s/ -type f -exec gzip {} \;'), + descriptionDone=['gzip artifacs dir content'])) +{% else %} factory.addStep(MasterShellCommand(command=Interpolate('find {{ public_artifacts_dir }}/%(prop:uuid)s/task_output/ -type f -exec gzip {} \;'), descriptionDone=['gzip artifacs dir content'])) +{% endif %} {% if deployment_type in ['local'] %} # copy taskotron log to master diff --git a/roles/taskotron/taskotron-master/tasks/main.yml b/roles/taskotron/taskotron-master/tasks/main.yml index 90374bc284..25748479a3 100644 --- a/roles/taskotron/taskotron-master/tasks/main.yml +++ b/roles/taskotron/taskotron-master/tasks/main.yml @@ -15,7 +15,10 @@ - /srv/taskotron/artifacts - name: copy artifacts httpd config - template: src=artifacts.conf.j2 dest=/etc/httpd/conf.d/artifacts.conf owner=root group=root + template: src={{ item }} dest=/etc/httpd/conf.d/artifacts.conf owner=root group=root + with_first_found: + - artifacts.conf.j2.{{ deployment_type }} + - artifacts.conf.j2 notify: - reload httpd diff --git a/roles/taskotron/taskotron-master/templates/artifacts.conf.j2.dev b/roles/taskotron/taskotron-master/templates/artifacts.conf.j2.dev new file mode 100644 index 0000000000..d8e868c933 --- /dev/null +++ b/roles/taskotron/taskotron-master/templates/artifacts.conf.j2.dev @@ -0,0 +1,62 @@ +Alias /artifacts {{ public_artifacts_dir }} + + + + Options +Indexes + IndexOptions +NameWidth=* + IndexOptions FancyIndexing + IndexOrderDefault Ascending Name + AllowOverride None + Require all granted + + + + + Options -Indexes + + + + + Options +Indexes + IndexOptions +NameWidth=* + AllowOverride None + Require all granted + + + +ExtFilterDefine gz-to-plain mode=output \ +intype=application/x-gzip outtype=text/plain \ +cmd="/bin/gunzip -c -" + +ExtFilterDefine gz-to-html mode=output \ +intype=application/x-gzip outtype=text/html \ +cmd="/bin/gunzip -c -" + +ExtFilterDefine gz-to-css mode=output \ +intype=application/x-gzip outtype=text/css \ +cmd="/bin/gunzip -c -" + + + RewriteEngine on + + RewriteCond "{{ public_artifacts_dir }}/all/$1/$2.gz" -f + RewriteCond "{{ public_artifacts_dir }}/all/$1/$2" !-f + RewriteRule "^{{ public_artifacts_dir }}/all/(.+)/(.*)$" "{{ public_artifacts_dir }}/all/$1/$2.gz" + + # mod_deflate doesnt work as expected for some reason + # use custom filter instead + + SetOutputFilter gz-to-plain + + + SetOutputFilter gz-to-css + + + SetOutputFilter gz-to-html + + + # keep the mod_deflate for reference though + #AddEncoding x-gzip .gz + #SetOutputFilter INFLATE + #ForceType text/plain +