taskotron: get rid for /task_output/ subdir in results URL (on dev)
This commit is contained in:
parent
a78c239de5
commit
95c1989180
3 changed files with 76 additions and 1 deletions
|
@ -244,12 +244,22 @@ factory.addStep(MasterShellCommand(command=["mkdir", '-m', '0755', Interpolate('
|
||||||
descriptionDone=['Create artifacs dir']))
|
descriptionDone=['Create artifacs dir']))
|
||||||
|
|
||||||
# copy artifacts to master
|
# 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/'),
|
factory.addStep(DirectoryUpload(slavesrc=Interpolate('/var/lib/taskotron/artifacts/%(prop:uuid)s/'),
|
||||||
masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/task_output')))
|
masterdest=Interpolate('{{ public_artifacts_dir }}/%(prop:uuid)s/task_output')))
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# gzip artifacts
|
# 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 {} \;'),
|
factory.addStep(MasterShellCommand(command=Interpolate('find {{ public_artifacts_dir }}/%(prop:uuid)s/task_output/ -type f -exec gzip {} \;'),
|
||||||
descriptionDone=['gzip artifacs dir content']))
|
descriptionDone=['gzip artifacs dir content']))
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if deployment_type in ['local'] %}
|
{% if deployment_type in ['local'] %}
|
||||||
# copy taskotron log to master
|
# copy taskotron log to master
|
||||||
|
|
|
@ -15,7 +15,10 @@
|
||||||
- /srv/taskotron/artifacts
|
- /srv/taskotron/artifacts
|
||||||
|
|
||||||
- name: copy artifacts httpd config
|
- 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:
|
notify:
|
||||||
- reload httpd
|
- reload httpd
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
Alias /artifacts {{ public_artifacts_dir }}
|
||||||
|
|
||||||
|
|
||||||
|
<Directory "{{ public_artifacts_dir }}">
|
||||||
|
Options +Indexes
|
||||||
|
IndexOptions +NameWidth=*
|
||||||
|
IndexOptions FancyIndexing
|
||||||
|
IndexOrderDefault Ascending Name
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
|
||||||
|
<Directory "{{ public_artifacts_dir }}/all">
|
||||||
|
Options -Indexes
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
|
||||||
|
<DirectoryMatch "^{{ public_artifacts_dir }}/all/(.+)/">
|
||||||
|
Options +Indexes
|
||||||
|
IndexOptions +NameWidth=*
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
</DirectoryMatch>
|
||||||
|
|
||||||
|
|
||||||
|
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 -"
|
||||||
|
|
||||||
|
<DirectoryMatch "^{{ public_artifacts_dir }}/all/(.+)/">
|
||||||
|
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
|
||||||
|
<FilesMatch "(?!html)">
|
||||||
|
SetOutputFilter gz-to-plain
|
||||||
|
</FilesMatch>
|
||||||
|
<FilesMatch "(?!css)">
|
||||||
|
SetOutputFilter gz-to-css
|
||||||
|
</FilesMatch>
|
||||||
|
<FilesMatch "(\.html\.gz|\.html)$">
|
||||||
|
SetOutputFilter gz-to-html
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# keep the mod_deflate for reference though
|
||||||
|
#AddEncoding x-gzip .gz
|
||||||
|
#SetOutputFilter INFLATE
|
||||||
|
#ForceType text/plain
|
||||||
|
</DirectoryMatch>
|
Loading…
Add table
Add a link
Reference in a new issue