harbor/tools/ova/script/firstboot.sh

53 lines
1.1 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 "%s\n%s\n" "$value" "$value" | passwd root
2016-10-25 12:09:54 +02:00
fi
#configure SSH
configSSH
2016-11-25 06:59:22 +01:00
echo "Adding rules to iptables..."
addIptableRules
2016-10-25 12:09:54 +02:00
echo "Installing docker compose..."
installDockerCompose
2016-12-02 06:41:38 +01:00
echo "Starting docker service..."
systemctl start docker
2016-10-25 12:09:54 +02:00
echo "Uncompress Harbor offline instaler tar..."
tar -zxvf $base_dir/../harbor-offline-installer*.tgz -C $base_dir/../
echo "Loading images..."
load
2016-11-29 07:12:02 +01:00
echo "Pushing photon to project library..."
pushPhoton
2016-10-25 12:09:54 +02:00
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 "===================================================="