New deployment script
This commit is contained in:
parent
01e0f10c38
commit
639c73a4cf
3
Makefile
3
Makefile
|
@ -7,10 +7,9 @@ PROVER=prove -f
|
|||
RM=rm
|
||||
TESTDIR=t
|
||||
SHELL=/bin/sh
|
||||
SU=/bin/su
|
||||
|
||||
launch:
|
||||
$(SU) -s /bin/sh -c "$(SHELL) process/launch.sh" intradmin
|
||||
$(SHELL) ./process/launch.sh
|
||||
|
||||
install:
|
||||
$(SHELL) commands/first-install.sh
|
||||
|
|
|
@ -5,8 +5,14 @@ cd $(dirname "$0")
|
|||
GREP='/bin/egrep'
|
||||
SCREEN='/usr/bin/screen'
|
||||
SED='/bin/sed -E'
|
||||
SU='/bin/su -s /bin/sh'
|
||||
PERL='/usr/bin/env perl'
|
||||
|
||||
launch_screen()
|
||||
{
|
||||
$SU -c "$SCREEN -S '$1' -d -m bash -c '$2'" intradmin
|
||||
}
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
HOSTNAME=`/bin/hostname`
|
||||
|
@ -15,34 +21,34 @@ else
|
|||
fi
|
||||
|
||||
# Kill old liblersorf screen sessions
|
||||
$SCREEN -ls | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
|
||||
$SU -c "$SCREEN -ls" intradmin | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
|
||||
while read LINE
|
||||
do
|
||||
SNAME=`echo $LINE | $SED "s/^[^0-9]*([0-9]+\.[^ \t]+).*$/\1/"`
|
||||
$SCREEN -S "$SNAME" -X kill
|
||||
$SU -c "$SCREEN -S \"$SNAME\" -X kill" intradmin
|
||||
done
|
||||
|
||||
case $HOSTNAME in
|
||||
|
||||
cpp)
|
||||
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys_forge -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys_forge.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_sync_ssh_keys_forge" "while true; do $PERL process/ldap/sync_ssh_keys_forge.pl; done"
|
||||
;;
|
||||
|
||||
hamano)
|
||||
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys_git -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys_git.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_sync_ssh_keys_git" "while true; do $PERL process/ldap/sync_ssh_keys_git.pl; done"
|
||||
;;
|
||||
|
||||
moore)
|
||||
$SCREEN -S lerdorf_process_ldap_check_ssh_key -d -m bash -c "while true; do $PERL process/ldap/check_ssh_key.pl; done"
|
||||
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys.pl; done"
|
||||
$SCREEN -S lerdorf_process_ldap_update_group -d -m bash -c "while true; do $PERL process/ldap/update_group.pl; done"
|
||||
$SCREEN -S lerdorf_process_ldap_update_user -d -m bash -c "while true; do $PERL process/ldap/update_user.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_check_ssh_key" "while true; do $PERL process/ldap/check_ssh_key.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_sync_ssh_keys" "while true; do $PERL process/ldap/sync_ssh_keys.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_update_group" "while true; do $PERL process/ldap/update_group.pl; done"
|
||||
launch_screen "lerdorf_process_ldap_update_user" "while true; do $PERL process/ldap/update_user.pl; done"
|
||||
|
||||
$SCREEN -S lerdorf_process_files_intradata_get -d -m bash -c "while true; do $PERL process/files/intradata_get.pl; done"
|
||||
launch_screen "lerdorf_process_files_intradata_get" "while true; do $PERL process/files/intradata_get.pl; done"
|
||||
;;
|
||||
|
||||
noyce)
|
||||
$SCREEN -S lerdorf_process_files_intradata_get -d -m bash -c "while true; do $PERL process/files/intradata_get.pl; done"
|
||||
launch_screen "lerdorf_process_files_intradata_get" "while true; do $PERL process/files/intradata_get.pl; done"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
|
Reference in New Issue
Block a user