|
@ -58,13 +58,18 @@ schema_seminar.pdf: |
|
|
schema_all.pdf: |
|
|
schema_all.pdf: |
|
|
./manage.py graph_models -a -g | dot -Tpdf > schema_all.pdf |
|
|
./manage.py graph_models -a -g | dot -Tpdf > schema_all.pdf |
|
|
|
|
|
|
|
|
|
|
|
# remote commands
|
|
|
|
|
|
|
|
|
TEST_USER=test-mam |
|
|
TEST_USER=test-mam |
|
|
TEST_SERVER=atrey.karlin.mff.cuni.cz |
|
|
TEST_SERVER=atrey.karlin.mff.cuni.cz |
|
|
TEST_DIR=/home/test-mam/mamweb-test/ |
|
|
TEST_DIR=/home/test-mam/mamweb-test/ |
|
|
|
|
|
|
|
|
# remote commands
|
|
|
PROD_USER=test-mam |
|
|
|
|
|
PROD_SERVER=atrey.karlin.mff.cuni.cz |
|
|
|
|
|
PROD_DIR=/home/test-mam/mamweb-prod/ |
|
|
|
|
|
|
|
|
HEAD=`git log --color=never |head -1|sed 's/.*commit //'` |
|
|
HEAD=`git log --color=never |head -1|sed 's/.*commit //'` |
|
|
|
|
|
|
|
|
push_test: |
|
|
push_test: |
|
|
@echo "Checking out commited HEAD (${HEAD}) state at ${TEST_SSH} ..." |
|
|
@echo "Checking out commited HEAD (${HEAD}) state at ${TEST_SSH} ..." |
|
|
git push --all |
|
|
git push --all |
|
@ -80,6 +85,24 @@ push_test: |
|
|
(chown -Rf :mam . || true ) && \
|
|
|
(chown -Rf :mam . || true ) && \
|
|
|
(chmod -Rf g+w . || true ) && \
|
|
|
(chmod -Rf g+w . || true ) && \
|
|
|
echo Done."
|
|
|
echo Done."
|
|
|
@echo "Test deployed at ${TEST_SERVER}:${TEST_DIR} successfully." |
|
|
@echo "Test pushed to ${TEST_SERVER}:${TEST_DIR} successfully." |
|
|
|
|
|
|
|
|
|
|
|
push_prod: |
|
|
|
|
|
@echo "Checking out commited HEAD (${HEAD}) state at ${PROD_SSH} ..." |
|
|
|
|
|
git push --all |
|
|
|
|
|
ssh ${PROD_USER}@${PROD_SERVER} -n -x "\
|
|
|
|
|
|
cd ${PROD_DIR} && \
|
|
|
|
|
|
./backup_prod_db.sh && \
|
|
|
|
|
|
git fetch --all && \
|
|
|
|
|
|
git checkout ${HEAD} -f && \
|
|
|
|
|
|
git clean -f && \
|
|
|
|
|
|
cp mamweb/settings_prod.py mamweb/settings.py && \
|
|
|
|
|
|
make install && \
|
|
|
|
|
|
./manage.py collectstatic --noinput && \
|
|
|
|
|
|
./manage.py migrate --noinput && \
|
|
|
|
|
|
(chown -Rf :mam . || true ) && \
|
|
|
|
|
|
(chmod -Rf g+w . || true ) && \
|
|
|
|
|
|
echo Done."
|
|
|
|
|
|
@echo "Deployed to ${PROD_SERVER}:${PROD_DIR} successfully." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|