From c20e5fb99a3408f328941c58f81289339f65f0f5 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Tue, 7 Apr 2015 18:07:41 +0700 Subject: [PATCH] Deployment --- Makefile | 10 ++++++++-- app/app.html | 1 - nginx.conf | 7 ++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 842e54a..2dd0590 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,12 @@ CSSMIN = ./node_modules/clean-css/bin/cleancss cloc: cloc . --exclude-dir=node_modules,app/bower_components,app/jsx/build/.module_cache -dist: +jsx: # Compiling JSX rm -rf app/jsx/build $(JSX) --extension jsx app/jsx app/jsx/build +js: # Compressing JS # # Get all script tags @@ -31,6 +32,7 @@ dist: | xargs cat \ | $(JSMIN) > build/app.js +css: # Compressing CSS # # Get all style tags @@ -41,9 +43,13 @@ dist: # Minification cat app/app.html \ | grep stylesheet \ - | grep -v fonts.googleapis.com \ | grep -v opensans \ | cut -d '"' -f 4 \ | sed -e 's/^/app/' \ | xargs cat \ | $(CSSMIN) -o build/app.css + +upload: + scp -r build www@empact.io:~/empact/build + +deploy: jsx js css upload diff --git a/app/app.html b/app/app.html index 7880e26..ee473ac 100644 --- a/app/app.html +++ b/app/app.html @@ -15,7 +15,6 @@ - diff --git a/nginx.conf b/nginx.conf index f6836fb..e965c41 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,12 +1,13 @@ upstream empact { - server 127.0.0.1:8080 weight=10; + server 127.0.0.1:8080; # Server with enabled profiling + # server 127.0.0.1:8080 weight=10; # server 127.0.0.1:8081 max_fails=1 fail_timeout=30s; } server { listen 80 default_server; - root /home/www/app/static; + root /home/www/empact/build; charset utf-8; location ~ ^/app/ { @@ -21,7 +22,7 @@ server { } location /favicon.ico { - alias /home/www/app/static/images/favicon.ico; + alias /home/www/empact/build/images/favicon.ico; add_header Cache-Control public; expires 1d; }