1
0
Fork 0

Deployment

This commit is contained in:
Gregory Eremin 2015-04-07 18:07:41 +07:00
parent 85c77f7dc9
commit c20e5fb99a
3 changed files with 12 additions and 6 deletions

View File

@ -5,11 +5,12 @@ CSSMIN = ./node_modules/clean-css/bin/cleancss
cloc: cloc:
cloc . --exclude-dir=node_modules,app/bower_components,app/jsx/build/.module_cache cloc . --exclude-dir=node_modules,app/bower_components,app/jsx/build/.module_cache
dist: jsx:
# Compiling JSX # Compiling JSX
rm -rf app/jsx/build rm -rf app/jsx/build
$(JSX) --extension jsx app/jsx app/jsx/build $(JSX) --extension jsx app/jsx app/jsx/build
js:
# Compressing JS # Compressing JS
# #
# Get all script tags # Get all script tags
@ -31,6 +32,7 @@ dist:
| xargs cat \ | xargs cat \
| $(JSMIN) > build/app.js | $(JSMIN) > build/app.js
css:
# Compressing CSS # Compressing CSS
# #
# Get all style tags # Get all style tags
@ -41,9 +43,13 @@ dist:
# Minification # Minification
cat app/app.html \ cat app/app.html \
| grep stylesheet \ | grep stylesheet \
| grep -v fonts.googleapis.com \
| grep -v opensans \ | grep -v opensans \
| cut -d '"' -f 4 \ | cut -d '"' -f 4 \
| sed -e 's/^/app/' \ | sed -e 's/^/app/' \
| xargs cat \ | xargs cat \
| $(CSSMIN) -o build/app.css | $(CSSMIN) -o build/app.css
upload:
scp -r build www@empact.io:~/empact/build
deploy: jsx js css upload

View File

@ -15,7 +15,6 @@
<link rel="stylesheet" href="/css/menu.css"> <link rel="stylesheet" href="/css/menu.css">
<link rel="stylesheet" href="/css/charts.css"> <link rel="stylesheet" href="/css/charts.css">
<link rel="stylesheet" href="/css/opensans.css"> <link rel="stylesheet" href="/css/opensans.css">
<!-- <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,600"> -->
</head> </head>
<body></body> <body></body>
<script src="/bower_components/react/react.js"></script> <script src="/bower_components/react/react.js"></script>

View File

@ -1,12 +1,13 @@
upstream empact { upstream empact {
server 127.0.0.1:8080 weight=10; server 127.0.0.1:8080;
# Server with enabled profiling # 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 127.0.0.1:8081 max_fails=1 fail_timeout=30s;
} }
server { server {
listen 80 default_server; listen 80 default_server;
root /home/www/app/static; root /home/www/empact/build;
charset utf-8; charset utf-8;
location ~ ^/app/ { location ~ ^/app/ {
@ -21,7 +22,7 @@ server {
} }
location /favicon.ico { location /favicon.ico {
alias /home/www/app/static/images/favicon.ico; alias /home/www/empact/build/images/favicon.ico;
add_header Cache-Control public; add_header Cache-Control public;
expires 1d; expires 1d;
} }