Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
4568dc3c
Commit
4568dc3c
authored
Feb 22, 2010
by
anarcat
Committed by
anarcat
Feb 22, 2010
Browse files
#711760
- separate backend and frontend install process in two shell scripts
parent
2cae2784
Changes
3
Hide whitespace changes
Inline
Side-by-side
INSTALL.txt
View file @
4568dc3c
...
...
@@ -35,9 +35,8 @@ considered the canonical source of information.
Also note that those instructions setup a complete Aegir system. If you want
to only setup a new server, it should be sufficient to install requirement
(step 1) and configure them (step 2). You will then need a copy of provision
and drush installed (parts of install.sh, which will need to be re-written to
take into account this use case).
(step 1) and configure them (step 2). Then you can run install-provision.sh
instead of running the whole install.sh script, to install the backend.
1. Install software requirements
================================
...
...
install-provision.sh
0 → 100644
View file @
4568dc3c
#! /bin/sh
# $Id$
########################################################################
# Aegir quick install script
#
# This script takes care of deploying all the required PHP scripts for
# the backend to run properly. It should be ran as the Aegir user.
#
# It should keep to strict POSIX shell syntax to ensure maximum
# portability. The aim here is to ease the burden on porters but also
# allow people using various platforms to zip through the install quicker.
#
# This script should be useable by packaging scripts to avoid code duplication,
# so it also needs to be idem-potent (ie. that it doesn't break if ran multiple
# times).
#
# This script also *DOES NOT CHECK* if the requirements described in
# INSTALL.txt have been met. It's up to the admin to follow the proper install
# instructions or use the packages provided by their platform.
########################################################################
# This script takes the following steps:
#
# 1. parse commandline
# 2. creates a basic directory structure in $AEGIR_HOME
# 3. downloads drush in $AEGIR_HOME
# 4. downloads drush_make in $AEGIR_HOME/.drush
# 5. downloads provision in $AEGIR_HOME/.drush
# 6. creates an apache config file in $AEGIR_HOME/config/apache.conf
########################################################################
# basic variables, change before release
AEGIR_HOME
=
$HOME
WEB_GROUP
=
www-data
DRUSH_VERSION
=
6.x-3.0-alpha1
DRUSH_MAKE_VERSION
=
6.x-2.0-beta6
# when adding a variable here, add it to the display below
########################################################################
# functions
# noticeable messages
msg
()
{
echo
"==>
$*
"
}
# simple prompt
prompt_yes_no
()
{
while
true
;
do
printf
"
$*
[Y/n] "
read
answer
if
[
-z
"
$answer
"
]
;
then
return
0
fi
case
$answer
in
[
Yy]|[Yy][Ee][Ss]
)
return
0
;;
[
Nn]|[Nn][Oo]
)
return
1
;;
*
)
echo
"Please answer yes or no"
;;
esac
done
}
usage
()
{
cat
<<
EOF
Usage:
$0
[ -h ] [ -w group ] [ -d home ]
EOF
}
########################################################################
# Main script
# stop on error
set
-e
# parse commandline
args
=
`
getopt V:w:d:h
$*
`
set
--
$args
for
i
do
case
"
$i
"
in
-w
)
shift
;
WEB_GROUP
=
$1
;
shift
;;
-h
)
shift
;
usage
;
exit
;;
-d
)
shift
;
AEGIR_HOME
=
$1
;
shift
;;
--
)
shift
;
break
;;
esac
done
DRUSH
=
"
$AEGIR_HOME
/drush/drush.php"
msg
"Aegir automated install script"
if
[
`
whoami
`
=
"root"
]
;
then
msg
"This script should be ran as a non-root user"
exit
1
fi
msg
"Configuring provision backend with the following settings:"
cat
<<
EOF
AEGIR_HOME=
$AEGIR_HOME
WEB_GROUP=
$WEB_GROUP
DRUSH=
$DRUSH
DRUSH_VERSION=
$DRUSH_VERSION
EOF
msg
"Creating basic directory structure"
mkdir
-p
$AEGIR_HOME
/config/vhost.d
mkdir
-p
$AEGIR_HOME
/backups
chmod
0711
$AEGIR_HOME
/config
chmod
0700
$AEGIR_HOME
/backups
# we need to check both because some platforms (like SunOS) return 0 even if the binary is not found
if
which drush 2> /dev/null
&&
which drush |
grep
-v
'no drush in'
>
/dev/null
;
then
msg
"Drush is in the path, good"
DRUSH
=
drush
elif
[
-x
$DRUSH
]
;
then
msg
"Drush found in
$DRUSH
, good"
DRUSH
=
"php
$AEGIR_HOME
/drush/drush.php"
else
msg
"Installing drush in
$AEGIR_HOME
"
cd
$AEGIR_HOME
wget http://ftp.drupal.org/files/projects/drush-
$DRUSH_VERSION
.tar.gz
gunzip
-c
drush-
$DRUSH_VERSION
.tar.gz |
tar
-xf
-
rm
drush-
$DRUSH_VERSION
.tar.gz
DRUSH
=
"php
$AEGIR_HOME
/drush/drush.php"
fi
if
$DRUSH
help
>
/dev/null
;
then
msg
"Drush seems to be functionning properly"
else
msg
"Drush is broken (
$DRUSH
help failed)"
exit
1
fi
if
$DRUSH
help
|
grep
"^ make"
>
/dev/null
;
then
msg
"Drush make already seems to be installed"
else
msg
"Installing drush make in
$AEGIR_HOME
/.drush"
mkdir
-p
$AEGIR_HOME
/.drush
$DRUSH
dl drush_make-
$DRUSH_MAKE_VERSION
--destination
=
$AEGIR_HOME
/.drush
fi
if
$DRUSH
help
|
grep
"^ provision install"
>
/dev/null
;
then
msg
"Provision already seems to be installed"
else
msg
"Installing provision backend in
$AEGIR_HOME
/.drush"
mkdir
-p
$AEGIR_HOME
/.drush
if
[
"
$AEGIR_VERSION
"
=
"HEAD"
]
;
then
git clone
-q
git://git.aegirproject.org/provision
$AEGIR_HOME
/.drush/provision
else
cd
$AEGIR_HOME
/.drush
wget http://files.aegirproject.org/provision-
$AEGIR_VERSION
.tgz
gunzip
-c
provision-
$AEGIR_VERSION
.tgz |
tar
-xf
-
rm
provision-
$AEGIR_VERSION
.tgz
fi
fi
if
[
-f
$AEGIR_HOME
/apache.conf
]
;
then
cat
>
$AEGIR_HOME
/apache.conf
<<
EOF
NameVirtualHost *:80
NameVirtualHost *:443
<IfModule !env_module>
LoadModule env_module modules/mod_env.so
</IfModule>
<IfModule !rewrite_module>
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
Include /var/aegir/config/vhost.d/
EOF
fi
msg
"Aegir provision backend installed successfully"
install.sh.txt
View file @
4568dc3c
...
...
@@ -12,7 +12,8 @@
# portability. The aim here is to ease the burden on porters but also
# allow people using various platforms to zip through the install quicker.
#
# Eventually, all this should be performed by the Provision backend.
# Eventually, this should just be a wrapper to install-provision, drush make
# and provision-install, see http://drupal.org/node/711760
#
# This script also *DOES NOT CHECK* if the requirements have been met.
# It's up to the admin to follow the proper install instructions or use
...
...
@@ -22,12 +23,9 @@
#
# 1. parse commandline
# 2. prompt for confirmation
# 3. creates a basic directory structure in $AEGIR_HOME
# 4. downloads drush in $AEGIR_HOME
# 5. downloads drush_make in $AEGIR_HOME/.drush
# 6. downloads provision in $AEGIR_HOME/.drush
# 7. deploys hostmaster in $AEGIR_HOME using drush
# 8. creates an apache config file in $AEGIR_HOME/config/vhost.d
# 3. call install-provision.sh to deploy the backend
# 4. deploys hostmaster in $AEGIR_HOME using drush
# 5. creates an apache config file in $AEGIR_HOME/config/vhost.d
#
########################################################################
# basic variables, change before release
...
...
@@ -136,57 +134,8 @@ else
exit 1
fi
msg "Creating basic directory structure"
mkdir -p $AEGIR_HOME/config/vhost.d
mkdir -p $AEGIR_HOME/backups
chmod 0711 $AEGIR_HOME/config
chmod 0700 $AEGIR_HOME/backups
# we need to check both because some platforms (like SunOS) return 0 even if the binary is not found
if which drush 2> /dev/null && which drush | grep -v 'no drush in' > /dev/null; then
msg "Drush is in the path, good"
DRUSH=drush
elif [ -x $DRUSH ] ; then
msg "Drush found in $DRUSH, good"
DRUSH="php $AEGIR_HOME/drush/drush.php"
else
msg "Installing drush in $AEGIR_HOME"
cd $AEGIR_HOME
wget http://ftp.drupal.org/files/projects/drush-$DRUSH_VERSION.tar.gz
gunzip -c drush-$DRUSH_VERSION.tar.gz | tar -xf -
rm drush-$DRUSH_VERSION.tar.gz
DRUSH="php $AEGIR_HOME/drush/drush.php"
fi
if $DRUSH help > /dev/null ; then
msg "Drush seems to be functionning properly"
else
msg "Drush is broken ($DRUSH help failed)"
exit 1
fi
if $DRUSH help | grep "^ make" > /dev/null ; then
msg "Drush make already seems to be installed"
else
msg "Installing drush make in $AEGIR_HOME/.drush"
mkdir -p $AEGIR_HOME/.drush
$DRUSH dl drush_make-$DRUSH_MAKE_VERSION --destination=$AEGIR_HOME/.drush
fi
if $DRUSH help | grep "^ provision install" > /dev/null ; then
msg "Provision already seems to be installed"
else
msg "Installing provision backend in $AEGIR_HOME/.drush"
mkdir -p $AEGIR_HOME/.drush
if [ "$AEGIR_VERSION" = "HEAD" ]; then
git clone git://git.aegirproject.org/provision $AEGIR_HOME/.drush/provision
else
cd $AEGIR_HOME/.drush
wget http://files.aegirproject.org/provision-$AEGIR_VERSION.tgz
gunzip -c provision-$AEGIR_VERSION.tgz | tar -xf -
rm provision-$AEGIR_VERSION.tgz
fi
fi
DIR=`dirname $0`
. $DIR/install-provision.sh -w $WEB_GROUP -d $AEGIR_HOME
if [ ! -d $HOSTMASTER_DIR ] ; then
msg "Deploying hostmaster application"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment