diff options
author | 2018-06-13 06:25:48 +0000 | |
---|---|---|
committer | 2018-06-13 06:25:49 +0000 | |
commit | bdf629c9cc029251264ef6939556607155970736 (patch) | |
tree | 3e8a1037bbd05f35ff200e1b7c96f6b960da1531 /deploy | |
parent | c6c79ab29ccf71547750c8907108b2320512050a (diff) | |
parent | 42d32610567f301ea5a3074aa0f3bbae185f601f (diff) |
Merge "using compass to deploy harbor for private docker registry"
Diffstat (limited to 'deploy')
-rwxr-xr-x | deploy/compass_vm.sh | 28 | ||||
-rwxr-xr-x | deploy/launch.sh | 7 |
2 files changed, 35 insertions, 0 deletions
diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh index 17171578..2f909b60 100755 --- a/deploy/compass_vm.sh +++ b/deploy/compass_vm.sh @@ -181,6 +181,34 @@ function recover_compass() { log_info "launch_compass exit" } +function launch_harbor() { + local harbor_install_dir=$WORK_DIR/installer + + if [[ ! -d $harbor_install_dir ]]; then + mkdir -p $harbor_install_dir + fi + + local harbor_cfg=$harbor_install_dir/harbor/harbor.cfg + local harbor_docker_compose=$harbor_install_dir/harbor/docker-compose.yml + rm -f $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz + curl --connect-timeout 10 -o $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz $HABOR_DOWNLOAD_URL + tar -zxf $WORK_DIR/cache/harbor-offline-installer-v$HABOR_VERSION.tgz -C $harbor_install_dir + + sed "s/^hostname = .*/hostname = $INSTALL_IP/g" -i $harbor_cfg + sed "s/80:80/8080:80/g" -i $harbor_docker_compose + sed "s/443:443/8443:443/g" -i $harbor_docker_compose + cd $harbor_install_dir/harbor/ + sudo ./prepare + if [ -n "$(docker-compose -f $harbor_docker_compose ps -q)" ] + then + log_info "stopping existing Harbor instance ..." + docker-compose -f $harbor_docker_compose down -v + log_info "remove the odler harbor images ..." + sudo docker images | grep 'vmware' | awk '{print $3;}' | xargs docker rmi -f + fi + ./install.sh +} + function _check_hosts_reachable() { retry=0 diff --git a/deploy/launch.sh b/deploy/launch.sh index 76e8f254..8a009003 100755 --- a/deploy/launch.sh +++ b/deploy/launch.sh @@ -90,6 +90,13 @@ else log_info "deploy host macs: $machines" fi +if [[ "$DEPLOY_HARBOR" == "true" ]]; then + if ! launch_harbor;then + log_error "launch_harbor failed" + exit 1 + fi +fi + if [[ "$REDEPLOY_HOST" != "true" ]]; then if ! set_compass_machine; then log_error "set_compass_machine fail" |