Skip to content
Snippets Groups Projects
Commit a20e3815 authored by iaibrys's avatar iaibrys
Browse files

Merge remote-tracking branch 'origin/master' into release-2019.0

* origin/master:
  Create cache volume to save getpdf results between sessions.
  Add Brotli compression
  Add CI/CD script which just syncs the source tree.
parents 5187f951 dd69c09c
No related branches found
No related tags found
No related merge requests found
Pipeline #371 failed
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
*.out *.out
/default.conf /default.conf
phantomjs phantomjs
.idea
...@@ -38,7 +38,6 @@ release-image: ...@@ -38,7 +38,6 @@ release-image:
- docker images | grep ${CI_PROJECT_PATH} - docker images | grep ${CI_PROJECT_PATH}
- docker push $CONTAINER_RELEASE_IMAGE - docker push $CONTAINER_RELEASE_IMAGE
deploy_devel: deploy_devel:
tags: tags:
- deploy-devel - deploy-devel
......
FROM nginx:alpine #FROM nginx:alpine
FROM fholzer/nginx-brotli
# We will map these using volumes # We will map these using volumes
RUN rm /etc/nginx/nginx.conf RUN rm /etc/nginx/nginx.conf
......
...@@ -478,19 +478,28 @@ server { ...@@ -478,19 +478,28 @@ server {
<% end %> <% end %>
location / { location / {
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 1;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript;
location /MathJax { location /MathJax {
rewrite ^/MathJax/(.*)$ /vendor/MathJax/$1; rewrite ^/MathJax/(.*)$ /vendor/MathJax/$1;
} }
location ~ ^/(assets|images|vendor|font|fonts)/ { location ~ ^/(assets|images|vendor|font|fonts|packs)/ {
brotli on;
brotli_types text/plain text/css application/json application/javascript application/x-javascript text/javascript;
brotli_comp_level 1;
gzip_comp_level 6;
gzip_static on; gzip_static on;
brotli_static on;
add_header Cache-Control public; add_header Cache-Control public;
expires 4w; expires 4w;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
gzip_comp_level 6;
gzip_types application/x-javascript text/css image/x-icon image/png image/jpeg image/gif;
add_header proxy_served_static gzip; add_header proxy_served_static gzip;
break; break;
} }
......
...@@ -3,6 +3,7 @@ require 'yaml' ...@@ -3,6 +3,7 @@ require 'yaml'
require 'set' require 'set'
require 'awesome_print' require 'awesome_print'
require 'colorize' require 'colorize'
require 'open3'
namespace :build do namespace :build do
...@@ -172,17 +173,32 @@ namespace :build do ...@@ -172,17 +173,32 @@ namespace :build do
private private
def log_and_run(cmd) def log_and_run(cmd)
logger.debug cmd logger.debug "Executing #{cmd}"
logger.debug `#{cmd}`
return $? wait_thr_value = Open3.popen2e(cmd) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each { |l| puts l }
end
stdin.close
wait_thread.value
end
if wait_thr_value.success?
logger.info "#{cmd}: Success!".green
else
logger.info "#{cmd}: Failed!".red
end
wait_thr_value.exitstatus
end end
def run_cmd(cmd, fail_message = nil) def run_cmd(cmd, fail_message = nil)
out = `#{cmd}` rv = log_and_run cmd
logger.info out if rv != 0
if $? != 0
if fail_message != nil if fail_message != nil
logger.error "#{cmd} failed with #{out}: #{fail_message}" logger.error "#{cmd} failed with #{rv}: #{fail_message}"
fail fail_message fail fail_message
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment