# vim: set filetype=nginx nofoldenable: # Configuration for the GROS prediction site. # Handle prediction data from Jenkins. location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}(api/v1(-(?P[-_0-9a-zA-Z]+))?)/ { {{{prediction_branch}}} if ($branch = "") { set $branch "master"; } {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/predict/jira/(?P[^/]+)/sprint/(?P\d+|latest)$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$project/$sprint.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/predict/jira/(?P[^/]+)/sprints$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$project/sprints.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/list/jira$ {{#jenkins_artifact}}prediction/$branch/output/$organization/projects.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/list/meta$ {{#jenkins_artifact}}prediction/$branch/output/$organization/projects_meta.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/configuration$ {{#jenkins_artifact}}prediction/$branch/output/$organization/configuration.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/dataset$ {{#jenkins_artifact}}prediction/$branch/output/sprint_features.arff{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/locale/(?Pdescriptions|tags|units|short_units|sources|metadata)$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$locale.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/links/(?P[^/]+)$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$project/sources.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/links/(?P[^/]+)/sprint/latest$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$project/links.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}api/v1(-[-_0-9a-zA-Z]+)?/links/(?P[^/]+)/sprint/(?P\d+)$ {{#jenkins_artifact}}prediction/$branch/output/$organization/$project/links.$sprint.json{{/jenkins_artifact}}{{/jenkins_rewrite}} {{^jenkins_direct}} proxy_pass http://{{#upstream}}jenkins:8080{{/upstream}}; {{/jenkins_direct}} add_header Access-Control-Allow-Origin *; } # ZIP download only available from Jenkins directly for now. {{^jenkins_direct}} location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/(?P[-_0-9a-zA-Z]+))/zip { {{{prediction_branch}}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)/zip$ {{{jenkins_path}}}/job/create-prediction/job/$branch/lastStableBuild/artifact/output/$organization/*zip*/archive.zip{{/jenkins_rewrite}} } {{/jenkins_direct}} location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)/ { {{{prediction_branch}}} if ($branch = "") { set $branch "master"; } {{#jenkins_redirect}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(?Pshow|branch/[-_0-9a-zA-Z]+)/(?P[^/]+)/$ {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}$path/$project{{/jenkins_redirect}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)/(?P[^/]+) {{#jenkins_report}}prediction-site/$branch/index.html?organization=$organization&project=$project{{/jenkins_report}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)/(?P[^/]+)/sprint/(?P\d+|latest) {{#jenkins_report}}prediction-site/$branch/index.html?organization=$organization&project=$project&sprint=$sprint{{/jenkins_report}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)(/[^/]+/sprint)?/(?P.+) {{#jenkins_report}}prediction-site/$branch/$path{{/jenkins_report}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(show|branch/[-_0-9a-zA-Z]+)/$ {{#jenkins_report}}prediction-site/$branch/index.html{{/jenkins_report}}{{/jenkins_rewrite}} {{^jenkins_direct}} proxy_pass http://{{#upstream}}jenkins:8080{{/upstream}}$uri; {{/jenkins_direct}} } location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}branches { rewrite ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}branches {{{jenkins_branches}}} break; add_header Access-Control-Allow-Origin *; {{^jenkins_direct}} proxy_pass http://{{#upstream}}jenkins:8080{{/upstream}}; {{/jenkins_direct}} } {{#files_share_id}} location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}papers/.*$ { {{#proxy_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}papers/(.*) http://{{#upstream}}owncloud{{/upstream}}/index.php/s/{{{files_share_id}}}/download?path=%2F&files=$1?{{/proxy_rewrite}} proxy_hide_header Content-Disposition; proxy_intercept_errors on; } location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}files { {{#proxy_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}files http://{{#upstream}}owncloud{{/upstream}}/index.php/apps/files_sharing/ajax/list.php?t={{{files_share_id}}}&dir=%2F&sort=name&sortdirection=asc{{/proxy_rewrite}} add_header Access-Control-Allow-Origin *; } {{/files_share_id}} autoindex off; {{#jenkins_redirect}}^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}(index\.html|show|papers/?)?$ {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}show/{{/jenkins_redirect}} {{#jenkins_redirect}}^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}}zip$ {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}show/zip{{/jenkins_redirect}} proxy_intercept_errors on; error_page 401 {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}401.html; error_page 403 {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}403.html; error_page 404 {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}404.html; error_page 500 502 503 504 {{#url}}{{{prediction_server}}}/{{{hub_redirect}}}{{{prediction_url}}}{{/url}}50x.html; location ~ ^{{{hub_regex}}}{{#path}}{{{prediction_url}}}{{/path}} { {{{hub_branch}}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(?P.+\.css|.+\.js.*) {{#jenkins_report}}prediction-site/$branch/$file{{/jenkins_report}}{{/jenkins_rewrite}} {{#jenkins_rewrite}}^{{{hub_rewrite}}}{{#path}}{{{prediction_url}}}{{/path}}(?P.+) {{#jenkins_report}}visualization-site/$branch/$file{{/jenkins_report}}{{/jenkins_rewrite}} {{^jenkins_direct}} proxy_pass http://{{#upstream}}jenkins:8080{{/upstream}}; {{/jenkins_direct}} }