Last active
October 27, 2017 07:02
-
-
Save ijobling/2c84c34ab400b66998b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################## | |
#### 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/2c84c34ab400b66998b3.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 | |
########################################################################## | |
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/4.3/4.3.2/+download/Plone-4.3.2-UnifiedInstaller.tgz -O - | tar -xzvf - | |
cd Plone-4.3.2-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 | |
echo -e '\E[1;33;44m' Remove script file"; tput sgr0 | |
rm ploneinst.sh | |
echo | |
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 Make a note of the admin username and password shown a few lines above this message. | |
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