[Hejes-devel] [766] main makefile: create_tag final version
hejes-devel at nytud.hu
hejes-devel at nytud.hu
Thu May 16 01:38:59 CEST 2013
Revision: 766
Author: mihaltz
Date: 2013-05-16 01:38:59 +0200 (Thu, 16 May 2013)
Log Message:
-----------
main makefile: create_tag final version
Modified Paths:
--------------
Makefile
Modified: Makefile
===================================================================
--- Makefile 2013-05-15 23:36:11 UTC (rev 765)
+++ Makefile 2013-05-15 23:38:59 UTC (rev 766)
@@ -1,36 +1,37 @@
DIR=/opt/web2py
APPDIR=helyesiras
-.PHONY : check-tag create_tag deploy dfm_on dfm_off restart
+.PHONY : check-tag check-tag-dir create_tag deploy dfm_on dfm_off restart
all:
-# This target is used by deploy and create_tag to check if variable TAG was set
-# TODO: also check if dir ./$(TAG) exists
+# This target is used to check if variable TAG was set
check-tag:
if test "$(TAG)" = "" ; then \
echo "Error: TAG not set"; \
exit 1; \
fi
+# This target is used to check if the directory tags/$(TAG) exists
+check-tag-dir: check-tag
+ if [ ! -d tags/$(TAG) ] ; then \
+ echo "Error: directory tags/$(TAG) does not exist" ; \
+ exit 1; \
+ fi
+
# create a new tag = a snapshot copy of trunk into the tags directory
# use "make create_tag TAG=XXXXX" to create tag XXXXX
create_tag: check-tag
- mkdir tags/$(TAG)
- svn add tags/$(TAG)
- svn ci tags/$(TAG) -m "Created dir tags/$(TAG)"
- svn copy file:///var/svn/helyesiras/trunk/web2py file:///var/svn/helyesiras/tags/$(TAG)/web2py -m "Creating tag $(TAG)"
+ svn copy --parents file:///var/svn/helyesiras/trunk/web2py file:///var/svn/helyesiras/tags/$(TAG)/web2py -m "Creating tag $(TAG)"
+ svn del file:///var/svn/helyesiras/tags/$(TAG)/web2py/applications/helyesiras_test -m "Removed unnecessary stuff from tag $(TAG)"
svn up
-# TODO: enable google analytics in menu.py
-# TODO: delete unnecesarry dir from web2py/applications
# TODO: update web2py/applications/helyesiras_webdev/VERSION
-
# Deploy the web2py application from the local ./tags/$(TAG)/ directory. Use e.g. "make deploy TAG=release-1.0" etc. in the command line.
# The ./tags/$(TAG)/web2py/applications/helyesiras_webdev svn directory will be exported into $(DIR)/applications/$(APPDIR)
# web2py should already be operational in /opt/web2py
# All required tools and packages should already be installed (see trunk/install/Makefile)
-deploy: check-tag
+deploy: check-tag-dir
echo Deploying $(TAG)...
sudo mkdir -p $(DIR)/applications/$(APPDIR)
sudo rm -I -R $(DIR)/applications/$(APPDIR)
@@ -47,18 +48,10 @@
# Put out the "down for maintenance" application as default
dfm_on:
cp /opt/web2py/routes.py.down /opt/web2py/routes.py
- sudo service uwsgi restart
- hostname >> maintenance.log
- date >> maintenance.log
- echo "Restarted uwsgi" >> maintenance.log
# Change the helyesiras application back as default
dfm_off:
cp /opt/web2py/routes.py.ezit /opt/web2py/routes.py
- sudo service uwsgi restart
- hostname >> maintenance.log
- date >> maintenance.log
- echo "Restarted uwsgi" >> maintenance.log
# Restart webserver
restart:
More information about the Hejes-devel
mailing list