Commit f0dc4bab authored by Aral Balkan's avatar Aral Balkan

Updated installation script and configuration template to conform to the new...

Updated installation script and configuration template to conform to the new directory structure of Better installations. Closes #5.
parent fd9023f6
Pipeline #378 skipped
Host dokku-local {builderDomain}
Hostname {builderDomain}
IdentityFile ~/better.fyi/builder/ssh/id_rsa
IdentityFile ~/better.fyi/.private/ssh/id_rsa
User dokku
Host data {dataDomain}
Hostname {dataDomain}
IdentityFile ~/better.fyi/builder/ssh/id_rsa
IdentityFile ~/better.fyi/.private/ssh/id_rsa
User generated
Host data {webDomain}
Hostname {webDomain}
IdentityFile ~/better.fyi/builder/ssh/id_rsa
IdentityFile ~/better.fyi/.private/ssh/id_rsa
User git
......@@ -167,8 +167,9 @@ echo -e "Configuring the Builder deployment environment…\n"
#
# Set the installation root folder.
#
readonly ROOT_BASE=~/better.fyi
readonly ROOT="${ROOT_BASE}/builder"
readonly ROOT=~/better.fyi
readonly PRIVATE=$ROOT/.private
readonly CONFIG=$PRIVATE/config
#
# Reset the local environment if necessary.
......@@ -216,26 +217,36 @@ fi
# Create the root.
mkdir -p $ROOT
# Create the private folder.
mkdir $PRIVATE
# Create the config folder.
mkdir $CONFIG
#
# Save the secrets
#
#
# Generate the configuration file from the template.
cp ./config.coffee.template $ROOT/config.coffee
#
configFile=$CONFIG/builder.coffee
cp ./config.coffee.template $configFile
sed -i "s/{TOKEN}/$gitlabWebHookToken/g" $ROOT/config.coffee
sed -i "s/{TOKEN}/$gitlabWebHookToken/g" $configFile
# Note: this will not work on OS X. The installation script is for Ubuntu 14.04
# only at the moment. The OS version would be:
# sed -i '' "s/{TOKEN}/$gitlabWebHookToken/g" $ROOT/config.coffee
# only at the moment. The OS X version would be:
# sed -i '' "s/{TOKEN}/$gitlabWebHookToken/g" $configFile
# Save the SSH keys into the folder the builder expects them in.
mkdir $ROOT/ssh
echo "$publicKey" > $ROOT/ssh/id_rsa.pub
echo "$privateKey" > $ROOT/ssh/id_rsa
sshDirectory=$PRIVATE/ssh
mkdir $sshDirectory
echo "$publicKey" > $sshDirectory/id_rsa.pub
echo "$privateKey" > $sshDirectory/id_rsa
# Restrict the permissions on the private ssh key
chmod 600 $ROOT/ssh/id_rsa
chmod 600 $sshDirectory/id_rsa
# Copy the SSH config file to ~/.ssh/ and configure it
# so that the correct key is served for SSH connections from the Builder server.
......@@ -244,14 +255,12 @@ sed -i "s/{builderDomain}/${builderDomain}/g" ~/.ssh/config
sed -i "s/{dataDomain}/${dataDomain}/g" ~/.ssh/config
sed -i "s/{webDomain}/${webDomain}/g" ~/.ssh/config
#
# Set up working copies of content and theme source repositories.
#
setupSourceRepositoryWorkingCopy "content"
setupSourceRepositoryWorkingCopy "themes"
#
# Set up working copies of the generated data repositories for the Better web site and the iOS app.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment