X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=Makefile;h=77fbf6bd4e64cc6e65cce05c33eb06b66b8f6bc6;hb=704e5e7811011025f35024d4c2531499b0284d14;hp=55ff9d280e0270f99635ee466b99c98d92da4aae;hpb=42149b7a846a3dce2f25bcb2b0775e8051d540ee;p=freeside.git diff --git a/Makefile b/Makefile index 55ff9d280..77fbf6bd4 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ HTTPD_RESTART = /etc/init.d/apache restart #openbsd #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 1; /usr/sbin/httpd -u -DSSL #apache -#HTTPD_RESTART = /usr/local/apache/bin/apachectl restart +#HTTPD_RESTART = /usr/local/apache/bin/apachectl stop; sleep 10; /usr/local/apache/bin/apachectl startssl FREESIDE_RESTART = ${INIT_FILE} restart @@ -57,9 +57,17 @@ QUEUED_USER=fs_queue FREESIDE_PATH = `pwd` SELFSERVICE_USER = fs_selfservice +#never run on the same machine in production!!! SELFSERVICE_MACHINES = localhost +# SELFSERVICE_MACHINES = www.example.com # SELFSERVICE_MACHINES = web1.example.com web2.example.com +#user with sudo access on SELFSERVICE_MACHINES for automated self-service +#installation. +SELFSERVICE_INSTALL_USER = ivan +SELFSERVICE_INSTALL_USERADD = /usr/sbin/useradd +#SELFSERVICE_INSTALL_USERADD = "/usr/sbin/pw useradd" + #--- #not changable yet @@ -151,6 +159,24 @@ install-init: s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\ " ${INIT_FILE} +install-selfservice: + [ -e ~freeside/.ssh/id_dsa.pub ] || su -c 'ssh-keygen -t dsa' - freeside + for MACHINE in ${SELFSERVICE_MACHINES}; do \ + scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\ + scp ~freeside/.ssh/id_dsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -D -o freeside -m 600 ./id_dsa.pub ~freeside/.ssh/authorized_keys" ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\ + done + +update-selfservice: + for MACHINE in ${SELFSERVICE_MACHINES}; do \ + rsync -rlptz fs_selfservice/FS-SelfService/ ${SELFSERVICE_INSTALL_USER}@$$MACHINE:FS-SelfService ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\ + ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\ + done + install: install-perl-modules install-docs install-init deploy: install