starting to get the install done

This commit is contained in:
Timothy Prepscius 2013-08-16 15:34:54 -04:00
parent a65b16c81b
commit f636de0f14
17 changed files with 102 additions and 7 deletions

View File

@ -1,6 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
server="red"
source ../config.hosts
server=$M_HOST_DEV
echo stopping...
ssh $1@$server "cd deploy && ./shutdown"

View File

@ -1,5 +1,6 @@
server="red"
source ../config.hosts
server=$M_HOST_DEV
echo restarting...
ssh tomcat@$server "cd deploy && ./restart"

View File

@ -1,5 +1,6 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
server="red"
source ../config.hosts
server=$M_HOST_DEV
ssh $1@$server "tail -n 100 -f run.log"

View File

@ -1,6 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
server="blue"
source ../config.hosts
server=$M_HOST_PROD
echo stopping...
ssh $1@$server "cd deploy && ./shutdown"

View File

@ -1,6 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
server="blue"
source ../config.hosts
server=$M_HOST_PROD
echo stopping...
ssh $1@$server "cd deploy && ./shutdown"

View File

@ -1,6 +1,7 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
server="blue"
source ../config.hosts
server=$M_HOST_PROD
echo stopping...
ssh $1@$server "cd deploy && ./shutdown"

View File

@ -1,5 +1,6 @@
server="blue"
source ../config.hosts
server=$M_HOST_PROD
echo restarting...
ssh tomcat@$server "cd deploy && ./restart"

3
host.config Normal file
View File

@ -0,0 +1,3 @@
M_ROOT="ubuntu"
M_HOST_PROD="your-prod-host"
M_HOST_DEV="your-dev-host"

View File

@ -0,0 +1,23 @@
Things you must do for this to work out of the box:
1. You must have .ssh keys for this account..
If you don't have them, generate them by googling "generate .ssh keys" and doing whatever it says.
2. You must go into the requirements directory and
a. run "./get_rsa_pub"
b. if you are going to install to an ec2 instance,
you must create the prod and dev instance and copy the key.pem file into requirements.
and then soft link the ec2-key.pem to your file.
c. and then, this is really important, you must
MUAHAHAHAHHAHAHA... just kidding, I'll write the rest soon.

View File

@ -0,0 +1,13 @@
set -x
USER=$1
sudo useradd -m $USER
sudo usermod -s /bin/bash $USER
sudo mkdir ../$USER/.ssh
sudo cp authorized_keys ../$USER/.ssh
sudo chown $USER ../$USER/.ssh ../$USER/.ssh/*
sudo chgrp $USER ../$USER/.ssh ../$USER/.ssh/*
sudo chmod 0700 ../$USER/.ssh
sudo chmod 0644 ../$USER/.ssh/authorized_keys

12
install/create-server-accounts Executable file
View File

@ -0,0 +1,12 @@
if [ -z "$1" ]; then echo "Must supply name"; exit 0; fi
set -x
source ../host.config
M_HOST=$1
scp -i requirements/ec2-key.pem requirements/id_rsa.pub $M_ROOT@$M_HOST:authorized_keys
scp -i requirements/ec2-key.pem create-server-accounts.remote $M_ROOT@$M_HOST:
scp -i requirements/ec2-key.pem create-server-account-user.remote $M_ROOT@$M_HOST:
ssh -i requirements/ec2-key.pem $M_ROOT@$M_HOST ./create-server-accounts.remote

View File

@ -0,0 +1,8 @@
set -x
./create-server-account-user.remote james
./create-server-account-user.remote mail-user
./create-server-account-user.remote mail-key
./create-server-account-user.remote tomcat
./create-server-account-user.remote tunnel
./create-server-account-user.remote tools

View File

@ -0,0 +1 @@
your-ec2-key.pem

View File

@ -0,0 +1 @@
cp ~/.ssh/id_rsa.pub .

7
install/setup-james Executable file
View File

@ -0,0 +1,7 @@
set -x
M_HOST=$1
scp setup-james.remote james@$M_HOST:
ssh james@$M_HOST ./setup-james.remote

11
install/setup-james.remote Executable file
View File

@ -0,0 +1,11 @@
set -x
wget http://apache.mirrors.pair.com//james/apache-james/3.0beta4/apache-james-3.0-beta4-app.tar.gz
tar xzvf apache-james-3.0-beta4-app.tar.gz
ln -s apache-james-3.0-beta4 apache-james
cd apache-james
mv conf conf-original
ln -s ../apache-james-conf conf
echo The final pieces will be installed during deploy

9
install/setup-servers Executable file
View File

@ -0,0 +1,9 @@
set -x
source ../host.config
./create-server-accounts $M_HOST_PROD
./create-server-accounts $M_HOST_DEV
./setup-james $M_HOST_PROD
./setup-james $M_HOST_DEV