Restored local js/css processing, removed superfluous .gitignore files, removed htacces-files, moved sample config to sample files
This commit is contained in:
parent
3b9f64b057
commit
23900670ca
6
.gitignore
vendored
6
.gitignore
vendored
@ -1 +1,7 @@
|
||||
*.swp
|
||||
deployment-config.mk
|
||||
scanner/venv
|
||||
scanner/floatapp/app.cfg
|
||||
*.pyc
|
||||
*.min.css
|
||||
*.min.js
|
||||
|
1
scanner/.gitignore
vendored
1
scanner/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.pyc
|
@ -1,19 +0,0 @@
|
||||
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json
|
||||
|
||||
<FilesMatch "\.(jpg|otf|ico)$">
|
||||
Header set Cache-Control "max-age=29030400, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "\.(css|js)$">
|
||||
Header set Cache-Control "max-age=5184000, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "index.html">
|
||||
Header set Cache-Control "max-age=2678400, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "\.json$">
|
||||
Header set Cache-Control "max-age=3600, public"
|
||||
</FilesMatch>
|
||||
|
||||
<FilesMatch "Makefile">
|
||||
deny from all
|
||||
</FilesMatch>
|
||||
|
69
web/Makefile
Normal file
69
web/Makefile
Normal file
@ -0,0 +1,69 @@
|
||||
JS_DIR = js
|
||||
CSS_DIR = css
|
||||
|
||||
JS_MIN = $(JS_DIR)/scripts.min.js
|
||||
CSS_MIN = $(CSS_DIR)/styles.min.css
|
||||
|
||||
JS_MIN_FILES := $(sort $(patsubst %.js, %.min.js, $(filter-out %.min.js, $(wildcard $(JS_DIR)/*.js))))
|
||||
CSS_MIN_FILES := $(sort $(patsubst %.css, %.min.css, $(filter-out %.min.css, $(wildcard $(CSS_DIR)/*.css))))
|
||||
|
||||
JS_COMPILER := java -jar bin/closure-compiler.jar --warning_level QUIET
|
||||
CSS_COMPILER := java -jar bin/yui-compressor.jar --type css
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
.PHONY: all deploy clean
|
||||
|
||||
all: $(JS_MIN) $(CSS_MIN)
|
||||
|
||||
ifeq ($(DEBUG),0)
|
||||
%.min.js: %.js
|
||||
@echo " JS " $@
|
||||
@$(JS_COMPILER) --js $< --js_output_file $@
|
||||
else
|
||||
%.min.js: %.js
|
||||
@echo " JS " $@
|
||||
@cat $< > $@
|
||||
endif
|
||||
|
||||
%.min.css: %.css
|
||||
@echo " CSS " $@
|
||||
@$(CSS_COMPILER) -o $@ $<
|
||||
|
||||
$(JS_MIN): $(JS_MIN_FILES)
|
||||
@echo " CAT " $@
|
||||
@cat $^ > $@
|
||||
|
||||
$(CSS_MIN): $(CSS_MIN_FILES)
|
||||
@echo " CAT " $@
|
||||
@cat $^ > $@
|
||||
|
||||
clean:
|
||||
@echo " RM " $(JS_MIN) $(JS_MIN_FILES) $(CSS_MIN) $(CSS_MIN_FILES)
|
||||
@rm -fv $(JS_MIN) $(JS_MIN_FILES) $(CSS_MIN) $(CSS_MIN_FILES)
|
||||
|
||||
include ../deployment-config.mk
|
||||
|
||||
SSH_OPTS := -q -o ControlMaster=auto -o ControlPath=.ssh-deployment.sock
|
||||
|
||||
deploy: all
|
||||
@echo " SSH $(WEB_SERVER)"
|
||||
@ssh $(SSH_OPTS) -Nf $(WEB_SERVER)
|
||||
|
||||
@echo " RSYNC . $(WEB_SERVER):$(HTDOCS_PATH)"
|
||||
@ssh -t $(SSH_OPTS) $(WEB_SERVER) "sudo -u $(HTDOCS_USER) -v"
|
||||
@rsync -aizm --delete-excluded --exclude=.ssh-deployment.sock --exclude=Makefile --exclude=*.swp \
|
||||
--exclude=bin/ --include=scripts.min.js --include=styles.min.css \
|
||||
--exclude=*.js --exclude=*.css --rsh="ssh $(SSH_OPTS)" \
|
||||
--rsync-path="sudo -n -u $(HTDOCS_USER) rsync" \
|
||||
. "$(WEB_SERVER):$(HTDOCS_PATH)"
|
||||
|
||||
@echo " CHOWN $(HTDOCS_USER):$(HTDOCS_USER) $(WEB_SERVER):$(HTDOCS_PATH)"
|
||||
@ssh -t $(SSH_OPTS) $(WEB_SERVER) "sudo chown -R $(HTDOCS_USER):$(HTDOCS_USER) '$(HTDOCS_PATH)'"
|
||||
|
||||
@echo " CHMOD 750/640 $(WEB_SERVER):$(HTDOCS_PATH)"
|
||||
@ssh -t $(SSH_OPTS) $(WEB_SERVER) "sudo find '$(HTDOCS_PATH)' -type f -exec chmod 640 {} \;; \
|
||||
sudo find '$(HTDOCS_PATH)' -type d -exec chmod 750 {} \;;"
|
||||
|
||||
@echo " SSH $(WEB_SERVER)"
|
||||
@ssh -O exit $(SSH_OPTS) $(WEB_SERVER)
|
BIN
web/bin/closure-compiler.jar
Normal file
BIN
web/bin/closure-compiler.jar
Normal file
Binary file not shown.
BIN
web/bin/yui-compressor.jar
Normal file
BIN
web/bin/yui-compressor.jar
Normal file
Binary file not shown.
1
web/css/.gitignore
vendored
1
web/css/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.min.css
|
@ -1,3 +0,0 @@
|
||||
<FilesMatch "(?<!min)\.css">
|
||||
deny from all
|
||||
</FilesMatch>
|
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# minify all .css-files
|
||||
ls -1 *.css|grep -Ev "min.css$" | while read cssfile; do
|
||||
newfile="${cssfile%.*}.min.css"
|
||||
echo "$cssfile --> $newfile"
|
||||
curl -X POST -s --data-urlencode "input@$cssfile" http://cssminifier.com/raw > $newfile
|
||||
done
|
||||
|
||||
# merge all into one single file
|
||||
rm -f styles.min.css
|
||||
cat *.min.css > styles.min.css
|
1
web/js/.gitignore
vendored
1
web/js/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.min.js
|
@ -1,3 +0,0 @@
|
||||
<FilesMatch "(?<!min)\.js">
|
||||
deny from all
|
||||
</FilesMatch>
|
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# minify all .js-files
|
||||
ls -1 *.js|grep -Ev "min.js$" | while read jsfile; do
|
||||
newfile="${jsfile%.*}.min.js"
|
||||
echo "$jsfile --> $newfile"
|
||||
curl -X POST -s --data-urlencode "input@$jsfile" http://javascript-minifier.com/raw > $newfile
|
||||
done
|
||||
|
||||
# merge all into one single file
|
||||
rm -f scripts.min.js
|
||||
cat *.min.js > scripts.min.js
|
Loading…
Reference in New Issue
Block a user