Browse Source

pull

master
zeus 3 years ago
parent
commit
57c9b9a7f3
  1. 31
      install/usr/share/swarmlab.io/sec/swarmlab-sec

31
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -37,7 +37,7 @@ EOF
# PACKAGES enabled ths with apt-get update && apt-get $APTPARAM install -y openssh-server $PACKAGES in in RUN export DEBIAN_FRONTEND=noninteractive
APTPARAM=" --no-install-recommends "
IMAGE_local="microservice-nodejs"
HYBRID_NETWORK="swarmlab-nodejs"
HYBRID_NETWORK="microservice-nodejs"
# dont edit
IMAGE_origin="hub.swarmlab.io:5480/hybrid-nodevuejs:latest"
bootstrap="sec_bootstrap"
@ -98,6 +98,12 @@ fi
create_dockerfile ()
{
docker pull $IMAGE_origin << ANSWERS
yes
yes
yes
ANSWERS
. $Wdir/ROOT_PASSWORD
if [ -d "$Wdir/project" ]; then
# -----------------------------------------------
@ -172,6 +178,12 @@ fi
create_project ()
{
docker pull $IMAGE_origin << ANSWERS
yes
yes
yes
ANSWERS
if [ "$Wdir" == "$HOME" ]; then
echo""
@ -273,6 +285,8 @@ services:
- NET_ADMIN
user: root
entrypoint: ["sec_bootstrap", "role=workerservice", "sec_master_service_name=masterservice", "sec_worker_service_name=workerservice"]
ports:
- "\${SSH_PORT}:22"
networks:
- ${HYBRID_NETWORK}
volumes:
@ -480,7 +494,14 @@ down_master ()
echo "$ docker-compose stop masterservice && docker-compose rm -f masterservice"
printf "\\n"
docker-compose stop masterservice && docker-compose rm -f masterservice
# docker-compose stop masterservice && docker-compose rm -f masterservice
docker-compose rm -f -s -v
docker-compose up --build --remove-orphans --force-recreate -d masterservice << ANSWERS
yes
yes
yes
ANSWERS
}
down_workers ()
@ -629,7 +650,7 @@ if [ $COMMAND_UP -eq 1 ]; then
generate_ssh_keys
build_and_push_image # remove for microservices
up_master
up_workers
#up_workers
prompt_ready
show_instruction
@ -650,7 +671,7 @@ elif [ $COMMAND_SCALE -eq 1 ]; then
down_master
down_workers
up_master
up_workers
#up_workers
prompt_ready
show_instruction
@ -661,7 +682,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then
down_workers
build_and_push_image
up_master
up_workers
#up_workers
prompt_ready
show_instruction

Loading…
Cancel
Save