Skip to content

Instantly share code, notes, and snippets.

@pigeonflight
Last active August 29, 2015 14:04
Show Gist options
  • Save pigeonflight/8c6a7cefcc34e41d00f1 to your computer and use it in GitHub Desktop.
Save pigeonflight/8c6a7cefcc34e41d00f1 to your computer and use it in GitHub Desktop.
##########################################################################
#### Script to copy install process explained in codio Plone tutorial
#### https://codio.com/s/docs/specifics/plone/
##########################################################################
#### Instructions
#### Option 1.
#### From the Codio Dashboard, create a new project and select the Git Tab
#### and then paste the following URL into the box
#### https://gist.github.com/8c6a7cefcc34e41d00f1.git
#### Give your project a name and click Create.
#### Option 2.
#### From the Codio Dashboard, create a new Empty template project.
#### Open a Terminal window from the Tools->Terminal window
#### Copy the contents of this file to a file called 'ploneinst.sh' in the root of your machines file system
### Then run the script in the terminal window by typing
### bash ploneinst.sh
#### End of Instructions
##########################################################################
# note the plone_version and plone_subversion are used to select the version of plone to install
plone_version=4.3
plone_subversion=4.3.3
echo
echo " START OF AUTOMATED INSTALL"
echo
# set the hostname variable
CODIO_HOST=`cat /etc/hostname`
# spinner borrowed from http://fitnr.com/showing-a-bash-spinner.html
spinner()
{
local pid=$1
local delay=0.75
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf " \b\b\b\b"
}
# set colour output = echo -e '\E[1;33;44m'
# remove colour = ; tput sgr0
# See http://www.tldp.org/LDP/abs/html/colorizing.html for colour codes
echo -e '\E[1;33;44m' "Install Plone"; tput sgr0
wget https://launchpad.net/plone/$plone_version/$plone_subversion/+download/Plone-$plone_subversion-UnifiedInstaller.tgz -O - | tar -xzvf -
cd Plone-$plone_subversion-UnifiedInstaller
echo -e '\E[1;33;44m' "installing (first pass)"; tput sgr0
./install.sh zeo --target=$HOME/workspace &
spinner $!
echo -e '\E[1;33;44m' "installing (second pass)"; tput sgr0
cd ~/workspace/zeocluster
bin/buildout &
spinner $!
echo -e '\E[1;33;44m' "let's install some convenience commands"; tput sgr0
wget https://gist.github.com/pigeonflight/6089807/download -O plonecommands.tgz
mkdir -p ~/bin
tar xfz plonecommands.tgz
cp `tar tfz plonecommands.tgz |head -1`plone* ~/bin/
chmod +x ~/bin/plone*
rm -rf `tar tfz plonecommands.tgz |head -1`
rm plonecommands.tgz
echo 'PATH=$PATH:$HOME/bin' >> ~/.bashrc
echo 'export PATH' >> ~/.bashrc
PATH=$PATH:$HOME/bin
export PATH
echo -e '\E[1;33;44m' "Install tmux box part"; tput sgr0
parts install tmux
echo -e '\E[1;33;44m' "Preview - Setup Menu - editing .codio file"; tput sgr0
echo '
{
"commands": {
"Start Plone":"plone-start.sh",
"Stop Plone":"plone-stop.sh",
"Debug Plone":"plone-debug.sh",
"Admin Password": "cat $HOME/workspace/zeocluster/adminPassword.txt"
},
"preview": {
"Dynamic Site": "http://{{domain}}:8080/",
"Static Index (static)": "https://{{domain}}/{{index}}",
"Current File (static)": "https://{{domain}}/{{filepath}}"
}
}' > ~/workspace/.codio
AdminPassword=`cat $HOME/workspace/zeocluster/adminPassword.txt`
echo
echo -e '\E[1;37;44m'" .......Plone Installed!"; tput sgr0
echo
echo You can start Plone using the Codio menu.
echo
echo In the Run menu - the 2nd from right most Codio menu,
echo you will now see options such as
echo Start Plone, Stop Plone, Debug Plone and Admin Password.
echo
echo To setup your first site Start Plone and wait about 20 seconds,
echo or until you see INFO Zope Ready to handle requests.
echo
echo The admin user name is;
echo
echo " admin"
echo
echo The admin password is;
echo
echo
echo " $AdminPassword"
echo
echo make a note of your Admin Password
echo
echo and then from the Preview menu - the right most Codio menu,
echo select Dynamic Site menu entry and click Create a new Plone site
echo in the browser tab that opens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment