-function install_docker_ce() {
- # installs and configures Docker CE
- echo "Installing Docker CE ..."
- sudo apt-get -qq update
- sudo apt-get install -y apt-transport-https ca-certificates software-properties-common
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get -qq update
- sudo apt-get install -y docker-ce
- echo "Adding user to group 'docker'"
- sudo groupadd -f docker
- sudo usermod -aG docker $USER
- sleep 2
- sudo service docker restart
- echo "... restarted Docker service"
- sg docker -c "docker version" || FATAL "Docker installation failed"
- echo "... Docker CE installation done"
- return 0
-}
-
-function install_docker_compose() {
- # installs and configures docker-compose
- echo "Installing Docker Compose ..."
- sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- echo "... Docker Compose installation done"
-}
-
-function install_juju() {
- echo "Installing juju"
- sudo snap install juju --classic
- [[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}"
- echo "Finished installation of juju"
- return 0
-}
-
-function juju_createcontroller() {
- if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then
- # Not found created, create the controller
- sudo usermod -a -G lxd ${USER}
- sg lxd -c "juju bootstrap --bootstrap-series=xenial $OSM_VCA_CLOUDNAME $OSM_STACK_NAME"
- fi
- [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
-}
-
-function juju_createproxy() {
- check_install_iptables_persistent
-
- if ! sudo iptables -t nat -C PREROUTING -p tcp -m tcp -d $DEFAULT_IP --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST; then
- sudo iptables -t nat -A PREROUTING -p tcp -m tcp -d $DEFAULT_IP --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST
- sudo netfilter-persistent save
- fi
-}
-
-function generate_docker_images() {
- echo "Pulling and generating docker images"
- _build_from=$COMMIT_ID
- [ -z "$_build_from" ] && _build_from="master"
-
- echo "OSM Docker images generated from $_build_from"
-
- BUILD_ARGS+=(--build-arg REPOSITORY="$REPOSITORY")
- BUILD_ARGS+=(--build-arg RELEASE="$RELEASE")
- BUILD_ARGS+=(--build-arg REPOSITORY_KEY="$REPOSITORY_KEY")
- BUILD_ARGS+=(--build-arg REPOSITORY_BASE="$REPOSITORY_BASE")