diff --git a/Makefile b/Makefile index 1ea73c485e994f142973e496900c5b3bd7b2c09d..4c2e4bc755692a416b3e6648780fcbd2c4b4901e 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,35 @@ +include ./config/path.makefile + + default: deploy @ -install: DB_install Tasker_install +install: DB_install Tasker_deploy + gulp install @ -deploy: DB_deploy Tasker_deploy Tasker_run +deploy: DB_deploy Tasker_deploy + gulp @ -Tasker_install: Tasker_deploy - gulp install - @ + +serverDeploy: DB_deploy Tasker_deploy + rsync -ru --exclude="application/config" --exclude="news.md" --exclude="updates.md" \ +~dev_rating/ $(DST_PATH) + gulp --release --force --dst=$(DST_PATH) + + + +# ----------------------- +# Tasker section Tasker_deploy: npm install -Tasker_run: - gulp +# ----------------------- +# database forwarding DB_%: @$(MAKE) $* -C ./db diff --git a/db/Makefile b/db/Makefile index a41ffdd8cb546a3ade33228eb49577d476aeb67f..ad7c9d8774aa436337b1eae241a057f5824989c9 100644 --- a/db/Makefile +++ b/db/Makefile @@ -16,10 +16,6 @@ ifeq ($(DB),) DB := $(shell bash -c 'read -p "Database: " db; echo $$db') endif -default: deploy - @ - - FLAGS := -u $(LOGIN) ifneq ($(PASS),) ifneq ($(PASS),"") @@ -49,16 +45,22 @@ deploy deploy: $(call GET_NAMES, stored) @ -clear: - @yes | mysqladmin $(FLAGS) drop $(DB) || true - @mysqladmin $(FLAGS) create $(DB); +fix: $(call GET_NAMES, fixes) + @ +clear: + @ yes | mysqladmin $(FLAGS) drop $(DB) || true + @ mysqladmin $(FLAGS) create $(DB); %: - @mysql $(FLAGS) $(DB) < $@.sql - @echo $@.sql + @ mysql $(FLAGS) $(DB) < $@.sql + @ echo $@.sql +hideData: + @ echo "UPDATE accounts SET Password = sha1('11111'), \ +ActivationCode= null, \ +EMail= null" | mysql $(FLAGS) $(DB) deploy_test: \ clear \ @@ -72,8 +74,5 @@ deploy \ fix -fix: $(call GET_NAMES, fixes) - @ -hideData: - @ echo "UPDATE accounts SET Password = sha1('11111'), ActivationCode= null, EMail= null" | mysql $(FLAGS) $(DB) + diff --git a/deploy/config/path.makefile b/deploy/config/path.makefile new file mode 100644 index 0000000000000000000000000000000000000000..f5fe1dd9810a1f99651cc1abf73734c2994ffce3 --- /dev/null +++ b/deploy/config/path.makefile @@ -0,0 +1 @@ +# DST_PATH = diff --git a/gulpfile.js b/gulpfile.js index 068c7c6f1cf62c6693400c3a1f12b6e72eadecaf..cb671a15ddc092d3a7a6d050804b134df0076fdc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,10 +9,12 @@ var varg = minimist(process.argv.slice(2), { default: {env: process.env.NODE_ENV || 'debug'} }); + var options = { - opt: varg.env !== 'debug' || varg.release, - inc: !varg.force, - beauty: varg.beauty || varg.rainbow + opt: varg.env !== 'debug' || varg.release, // optimize + inc: !varg.force, // incremental build + beauty: varg.beauty || varg.rainbow, + dst: varg.dst }; @@ -44,15 +46,18 @@ var paths = new (function () { var self = this; self.root = '.'; + var src = '.'; + var dst = options.dst || self.root + '/~dev_rating'; + var app = self.root + '/~dev_rating'; - var media = self.root + '/media'; - var stat = app + '/static'; + var media = src + '/media'; + var stat = dst + '/static'; self.src = { css: media + '/css/**/*.css', less: media + '/less/**/*.less', js: media + '/js/**/*.js', - config: self.root + '/deploy/phpConfig/*', + config: src + '/deploy/phpConfig/*', css_components: media + '/components/**/*.css', js_components: media + '/components/**/*.js' }; @@ -62,7 +67,7 @@ var paths = new (function () { css: stat + '/css/', less: stat + '/css/', js: stat + '/js/', - config: app + '/application/config/', + config: dst + '/application/config/', css_components: stat + '/components/', js_components: stat + '/components/' };