Commit 625e1975 authored by Valentino Lauciani's avatar Valentino Lauciani
Browse files

Update

parent 7e903849
......@@ -66,7 +66,7 @@ configure_public_keys()
configure_apt()
{
echo_date "apt-get update and install"
echo_date "Installing packages:"
# install needed bits in a loop because a lot of installs happen
# on VM init, so won't be able to grab the dpkg lock immediately
......@@ -75,18 +75,21 @@ configure_apt()
echo "Trying again"
sleep 2
done
echo_date "Done"
echo ""
}
configure_git()
{
echo_date "Configuring \"git\":"
local host=${1}
local user=${2}
local repo=${3}
local key=${4}
echo_date "Configuring git key $key"
echo_date "Configuring git connectivity for $repo"
echo_date "Registering git domain: $host"
echo "Configuring git key $key"
echo "Configuring git connectivity for $repo"
echo "Registering git domain: $host"
if [ ! -z "$key" ]; then
setup_sshkey $key $host $user
......@@ -94,12 +97,14 @@ configure_git()
# remove html dir so we can clone into it
rm -rf ${GITBASEDIRCURREPO}
echo_date "Attemtping git clone of dncc repo.."
echo_date "git clone git@$host:$user/$repo.git ${GITBASEDIRCURREPO}"
echo " Attemtping git clone of dncc repo.."
echo " git clone git@$host:$user/$repo.git ${GITBASEDIRCURREPO}"
git clone git@$host:$user/$repo.git ${GITBASEDIRCURREPO}
else
echo_date "no SSH private key. Skipping setup"
echo_date " No SSH private key. Skipping setup"
fi
echo_date "Done"
echo ""
}
configure_nginx()
......@@ -116,6 +121,7 @@ configure_nginx()
ln -s ${GITBASEDIRCURREPO}/cnt.rm.ingv.it/root/etc/nginx/conf.d/cnt.conf
service nginx configtest
service nginx restart
echo ""
}
configure_iptables()
......@@ -206,7 +212,7 @@ configure_public_keys 2>&1 >> ${OUTPUTFILE}
configure_apt 2>&1 >> ${OUTPUTFILE}
configure_git $gitHostName $gitGroupName $gitRepoName $gitSshPrivateKey 2>&1 >> ${OUTPUTFILE}
configure_nginx 2>&1 >> ${OUTPUTFILE}
configure_iptables 2>&1 >> ${OUTPUTFILE}
configure_fail2ban 2>&1 >> ${OUTPUTFILE}
configure_iptables 2>&1 >> ${OUTPUTFILE}
cat $OUTPUTFILE
Supports Markdown
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