|
@ -81,23 +81,12 @@ service_URL=http |
|
|
DOCKERuser="docker" |
|
|
DOCKERuser="docker" |
|
|
|
|
|
|
|
|
Wdir=${cwdir}/$IMAGE_local |
|
|
Wdir=${cwdir}/$IMAGE_local |
|
|
|
|
|
if [ ! -d $Wdir ]; then |
|
|
|
|
|
mkdir -p $Wdir |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# edit it - EDIT_END |
|
|
# edit it - EDIT_END |
|
|
|
|
|
|
|
|
# you do not need to edit it - BEGIN |
|
|
|
|
|
cat << FOE > swarmlab-index.js |
|
|
|
|
|
export const myApiConfig = [ |
|
|
|
|
|
{ |
|
|
|
|
|
"swarmlabname": "$IMAGE_local", |
|
|
|
|
|
"git": "$GIT_origin", |
|
|
|
|
|
"gui": $service_GUI, |
|
|
|
|
|
"web": $service_WEB, |
|
|
|
|
|
"url": "$service_URL", |
|
|
|
|
|
"version": 0, |
|
|
|
|
|
"port": 0 |
|
|
|
|
|
} |
|
|
|
|
|
]; |
|
|
|
|
|
FOE |
|
|
|
|
|
APTPARAM=" --no-install-recommends " |
|
|
APTPARAM=" --no-install-recommends " |
|
|
HYBRID_NETWORK=$IMAGE_local |
|
|
HYBRID_NETWORK=$IMAGE_local |
|
|
bootstrap="sec_bootstrap" |
|
|
bootstrap="sec_bootstrap" |
|
@ -106,26 +95,12 @@ hostnames_get="get_hosts" |
|
|
NODENAME=${IMAGE_local}_masterservice_1.${IMAGE_local}_${HYBRID_NETWORK} |
|
|
NODENAME=${IMAGE_local}_masterservice_1.${IMAGE_local}_${HYBRID_NETWORK} |
|
|
NODENETWORK=${HYBRID_NETWORK} |
|
|
NODENETWORK=${HYBRID_NETWORK} |
|
|
|
|
|
|
|
|
# shellcheck disable=SC1091 |
|
|
|
|
|
#. ./.env |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
|
# ----------------------------------------------- |
|
|
# |
|
|
# |
|
|
# Load Default config swarmlab.io |
|
|
# Load Default config swarmlab.io |
|
|
# |
|
|
# |
|
|
# ---------------------------------------------- |
|
|
# ---------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
|
|
|
|
# |
|
|
|
|
|
# Find Working dir |
|
|
|
|
|
# |
|
|
|
|
|
# ---------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
function EPHEMERAL_PORT() { |
|
|
function EPHEMERAL_PORT() { |
|
|
LOW_BOUND=49152 |
|
|
LOW_BOUND=49152 |
|
|
RANGE=16384 |
|
|
RANGE=16384 |
|
@ -141,7 +116,6 @@ function EPHEMERAL_PORT() { |
|
|
|
|
|
|
|
|
servicesshport=$(EPHEMERAL_PORT) |
|
|
servicesshport=$(EPHEMERAL_PORT) |
|
|
|
|
|
|
|
|
Wdir=$(pwd) |
|
|
|
|
|
|
|
|
|
|
|
if [ ! -f $Wdir/.env ]; then |
|
|
if [ ! -f $Wdir/.env ]; then |
|
|
cat << EOF > $Wdir/.env |
|
|
cat << EOF > $Wdir/.env |
|
@ -149,9 +123,11 @@ REGISTRY_ADDR=localhost |
|
|
REGISTRY_PORT=5000 |
|
|
REGISTRY_PORT=5000 |
|
|
IMAGE_NAME=$HYBRID_NETWORK |
|
|
IMAGE_NAME=$HYBRID_NETWORK |
|
|
SSH_PORT=$servicesshport |
|
|
SSH_PORT=$servicesshport |
|
|
WEB_PORT=$(EPHEMERAL_PORT) |
|
|
R_PORT1=$(EPHEMERAL_PORT) |
|
|
WEB_PORT1=$(EPHEMERAL_PORT) |
|
|
R_PORT2=$(EPHEMERAL_PORT) |
|
|
WEB_PORT2=$(EPHEMERAL_PORT) |
|
|
R_PORT3=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT4=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT5=$(EPHEMERAL_PORT) |
|
|
EOF |
|
|
EOF |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -352,6 +328,20 @@ fi |
|
|
/bin/cp -rf $SRPATH/install-vim-plugin.sh $Wdir/install-vim-plugin.sh |
|
|
/bin/cp -rf $SRPATH/install-vim-plugin.sh $Wdir/install-vim-plugin.sh |
|
|
# you do not need to edit it - END |
|
|
# you do not need to edit it - END |
|
|
|
|
|
|
|
|
|
|
|
# you do not need to edit it - BEGIN |
|
|
|
|
|
cat << FOE > $Wdir/swarmlab-index.js |
|
|
|
|
|
export const myApiConfig = [ |
|
|
|
|
|
{ |
|
|
|
|
|
"swarmlabname": "$IMAGE_local", |
|
|
|
|
|
"git": "$GIT_origin", |
|
|
|
|
|
"gui": $service_GUI, |
|
|
|
|
|
"web": $service_WEB, |
|
|
|
|
|
"url": "$service_URL", |
|
|
|
|
|
"version": 0, |
|
|
|
|
|
"port": 0 |
|
|
|
|
|
} |
|
|
|
|
|
]; |
|
|
|
|
|
FOE |
|
|
|
|
|
|
|
|
# ############################### |
|
|
# ############################### |
|
|
# EDIT-BEGIN |
|
|
# EDIT-BEGIN |
|
|