Skip to content
Snippets Groups Projects
Commit cef3a2ef authored by PavelBegunkov's avatar PavelBegunkov
Browse files

deploy scripts mod

parent af36f4c4
Branches
Tags
No related merge requests found
Showing with 81 additions and 126 deletions
......@@ -9,6 +9,7 @@ db/disciplines activity.sql
!~dev_rating/static/img/
!~dev_rating/static/other/
node_modules/
/config
*.*~
*.DS_STORE
......
......@@ -2,15 +2,15 @@ default: deploy
@
install: DB_install Tasker_install Tasker_run
install: DB_install Tasker_install
@
deploy: DB_deploy Tasker_deploy Tasker_run
@
Tasker_install: Tasker_deploy
gulp install
@
Tasker_deploy:
......
......@@ -2,10 +2,38 @@ define GET_NAMES
$(subst .sql, , $(wildcard $1/*.sql))
endef
CONFIG_PATH = ../config/db.makefile
include $(CONFIG_PATH)
ifeq ($(LOGIN),)
LOGIN := $(shell bash -c 'read -p "DB Username: " login; echo $$login')
endif
ifeq ($(PASS),)
PASS := $(shell bash -c 'read -s -p "DB Password: " pwd; echo $$pwd')
endif
ifeq ($(DB),)
DB := $(shell bash -c 'read -p "Database: " db; echo $$db')
endif
default: deploy
@
FLAGS := -u $(LOGIN)
ifneq ($(PASS),)
ifneq ($(PASS),"")
FLAGS += --password=$(PASS)
endif
endif
ifneq ($(PORT),)
FLAGS += --port=$(PORT)
endif
ifneq ($(HOST),)
FLAGS += --host=$(HOST)
endif
USER := $(shell bash -c 'read -p "Username: " username; echo $$username')
PASS := $(shell bash -c 'read -s -p "Password: " pwd; echo $$pwd')
DB := mmcs_rating
default: deploy
@
......@@ -22,11 +50,30 @@ deploy: $(call GET_NAMES, stored)
@
clear:
yes | mysqladmin -u $(USER) $(PASS) drop $(DB) || true
mysqladmin -u $(USER) $(PASS) create $(DB);
@yes | mysqladmin $(FLAGS) drop $(DB) || true
@mysqladmin $(FLAGS) create $(DB);
%:
mysql -u $(USER) $(PASS) $(DB) < $@.sql
@mysql $(FLAGS) $(DB) < $@.sql
@echo $@.sql
deploy_test: \
clear \
../../mmcs_rating \
fix \
deploy \
hideData
update: \
deploy \
fix
fix: $(call GET_NAMES, fixes)
@
hideData:
@ echo "UPDATE accounts SET Password = sha1('11111'), ActivationCode= null, EMail= null" | mysql $(FLAGS) $(DB)
# LOGIN = root
# PASS = ""
# DB = accounting_system
# PORT = 3306
# HOST = 127.0.0.1
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -10,7 +10,7 @@ fi
if [ -z $2 ] || ![ -d $2 ]
then
d=~/public_html/
else
else
d=$2
fi
......@@ -22,4 +22,3 @@ cd ..
# old copy cp -rp ${s}~dev_rating/* $d
rsync -ru --exclude="java" ${s}~dev_rating/ $d/
cp ${s}~dev_rating/.htaccess ${d}/.htaccess
rm -rf ${d}/application/config
#source
if [ -z $1 ] || ![ -d $1 ]
then
s=~/grade-rating/
else
s=$1
fi
#destination
if [ -z $2 ] || ![ -d $2 ]
then
d=~/public_html/
else
d=$2
fi
#shopt -s dotglob
cp -rp ${s}~dev_rating/* $d
cp ${s}~dev_rating/.htaccess ${d}/.htaccess
rm -rf ${d}/application/config
echo -n "Enter password for mysql user 'mmcs_rating': "
read -s mysqlpswd
echo ""
yes | mysqladmin -u mmcs_rating -p$mysqlpswd drop mmcs_rating
mysqladmin -u mmcs_rating -p$mysqlpswd create mmcs_rating
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/Structure.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredProcedures.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/Sample.sql
......@@ -10,25 +10,24 @@ fi
if [ -z $2 ] || ![ -d $2 ]
then
d=~/data/
else
else
d=$2
fi
#shopt -s dotglob
rm -rf ${s}~dev_rating/application/config
rm -rf ${s}~dev_rating/application/news.md
rm -rf ${s}~dev_rating/application/updates.md
cp -rp ${s}~dev_rating/* $d
cp ${s}~dev_rating/.htaccess ${d}/.htaccess
rm -rf ${d}/application/config
echo -n "Enter password for mysql user 'mmcs_rating': "
read -s mysqlpswd
echo ""
yes | mysqladmin -u mmcs_rating -p$mysqlpswd drop mmcs_rating
mysqladmin -u mmcs_rating -p$mysqlpswd create mmcs_rating
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/Structure.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredProcedures.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/release_gen_mmcs_sg.sql
cd ${s}/db
make deploy
cd ../../
sed -i 's/~dev_rating//g' ${d}.htaccess
sed -i 's/\/~dev_rating//g' ${d}application/bootstrap.php
sed -i 's/\/~dev_rating//g' ${d}media/js/config.js
chmod u=rwx,g=rx,o=r ./data/index.php
\ No newline at end of file
chmod u=rwx,g=rx,o=r ./data/index.php
#p - production
#s - sandbox
if [ -z $1 ]
then
s='s'
else
s=$1
fi
if [ $s != 's' ] && [ $s != 'p' ]
then
exit
fi
if [ $s = 's' ]
then
dep_script=deploy.sh
fi
if [ $s = 'p' ]
then
dep_script=deploy_release.sh
fi
rm -rf ~/grade-rating/
git clone http://itlab.mmcs.sfedu.ru/git/grade-rating ~/grade-rating/
cp ~/grade-rating/${dep_script} ./${dep_script}
chmod +x ./${dep_script}
./${dep_script}
......@@ -10,24 +10,12 @@ fi
if [ -z $2 ] || ![ -d $2 ]
then
d=~/public_html/
else
else
d=$2
fi
./copy.sh ${s} ${d}
echo -n "Enter password for mysql user 'mmcs_rating': "
read -s mysqlpswd
echo ""
yes | mysqladmin -u mmcs_rating -p$mysqlpswd drop mmcs_rating
mysqladmin -u mmcs_rating -p$mysqlpswd create mmcs_rating
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ./mmcs_rating.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/fix.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/Views.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredFunctions.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredProcedures.sql
echo "UPDATE accounts SET Password = sha1('11111')" | mysql -u mmcs_rating -p$mysqlpswd mmcs_rating
echo "UPDATE accounts SET ActivationCode= null" | mysql -u mmcs_rating -p$mysqlpswd mmcs_rating
echo "UPDATE accounts SET EMail= null" | mysql -u mmcs_rating -p$mysqlpswd mmcs_rating
cd ${s}/db
make deploy_test
cd ../../
......@@ -10,17 +10,12 @@ fi
if [ -z $2 ] || ![ -d $2 ]
then
d=~/public_html/
else
else
d=$2
fi
./copy.sh ${s} ${d}
echo -n "Enter password for mysql user 'mmcs_rating': "
read -s mysqlpswd
echo ""
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/fix.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/Views.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredProcedures.sql
mysql -u mmcs_rating -p$mysqlpswd mmcs_rating < ${s}db/StoredFunctions.sql
cd ${s}/db
make update
cd ../../
......@@ -52,7 +52,7 @@ var paths = new (function () {
css: media + '/css/**/*.css',
less: media + '/less/**/*.less',
js: media + '/js/**/*.js',
config: self.root + '/config/*',
config: self.root + '/deploy/phpConfig/*',
css_components: media + '/components/**/*.css',
js_components: media + '/components/**/*.js'
};
......
Кафедра Алгебры и Дискретной Математики
Штейнберг Роман Борисович
Стребежев Игорь Алексеевич
Бегунков Павел
Кафедра Информатики и Вычислительного Эксперимента
Брагилевский Виталий Николаевич
Пеленицын Артём Михайлович
Сенченко Наталья Николаевна
Без кафедры
Энакин Скайуокер
Оби-Ван Кеноби
Мастер Йода
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment