harbor/tools/ova/script/firstboot.sh

50 lines
1.0 KiB
Bash
Raw Normal View History

2016-10-25 12:09:54 +02:00
#!/bin/bash
set -e
echo "======================= $(date)====================="
export PATH=$PATH:/usr/local/bin
base_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $base_dir/common.sh
#Reset root password
value=$(ovfenv -k root_pwd)
if [ -n "$value" ]
then
echo "Resetting root password..."
printf "$value\n$value\n" | passwd root
fi
#configure SSH
configSSH
2016-10-25 12:09:54 +02:00
#echo "Adding rules to iptables..."
addIptableRules
2016-10-25 12:09:54 +02:00
echo "Installing docker compose..."
installDockerCompose
echo "Starting docker service..."
systemctl start docker
echo "Uncompress Harbor offline instaler tar..."
tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
echo "Loading images..."
load
echo "Configuring Harbor..."
chmod 600 $base_dir/../harbor/harbor.cfg
2016-11-10 09:18:13 +01:00
$base_dir/firstboot_config.sh
2016-10-25 12:09:54 +02:00
#Start Harbor
echo "Starting Harbor..."
up
2016-11-10 08:11:29 +01:00
echo "Removing unneeded installation packages..."
rm $base_dir/../harbor-offline-installer*.tgz
rm $base_dir/../harbor/harbor*.tgz
2016-10-25 12:09:54 +02:00
echo "===================================================="