############# run separately ############
##### Please ensure use ubuntu user. #####
sudo su - ubuntu
# Prepare build installer folder
sudo mkdir -p /data && sudo chown -R $(whoami):$(whoami) /data && cd /data
# Install docker
sudo apt install -y docker.io=17.12.1-0ubuntu1
# Add user to docker group
sudo usermod -a -G docker $(whoami)
sudo chown -R $(whoami):$(whoami) /home/$(whoami)/
############# run separately ############
##### Exit current session and re-login again so that to enable user group. #####
exit
cd /data
# Copy build-installer.sh to host and prepare installer package.
# vim build-installer.sh
# run build-installer with correct branch name
bash build-installer.sh [branch]
# package installer files into tarball and generate hash code
tarball_name=Mercury_v1.1.0_$(date +%Y-%m-%d_%H-%M-%S_%Z).tar
tar -cvf $tarball_name .
sha1sum $tarball_name
# when build installer on Diamond Host, DO REMOVE docker.io that installed within build-installer.sh since it will impact real diamond deployment.
sudo apt remove docker.io