Update scripts based on bugs found building -herbal3d

This commit is contained in:
Robert Adams
2022-08-18 16:30:54 +00:00
parent 1fffda3742
commit e445701415
10 changed files with 139 additions and 21 deletions
@@ -32,8 +32,8 @@ fi
echo "opensim-docker: updateConfigFiles.sh: replacing vars in \"${CONFIGDIR}/misc.ini\""
# If the replacement has already happened, this is a NOOP
sed --in-place \
-e "s/MYSQL_DB_USER/$MYSQL_DB_USER/" \
-e "s/MYSQL_DB_USER_PASSWORD/$MYSQL_DB_USER_PASSWORD/" \
-e "s/MYSQL_DB_USER/$MYSQL_DB_USER/" \
-e "s/MYSQL_DB_SOURCE/$MYSQL_DB_SOURCE/" \
-e "s/MYSQL_DB_DB/$MYSQL_DB_DB/" \
-e "s/PW_FOR_DEFAULT_ESTATE_OWNER/$PW_FOR_DEFAULT_ESTATE_OWNER/" \
+28
View File
@@ -0,0 +1,28 @@
#! /bin/bash
# Stop the running opensimulator
BASE=$(pwd)
export CONFIG_NAME=${CONFIG_NAME:-standalone}
# This export fakes out the environment setup script to look for files in
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
source config/scripts/setEnvironment.sh
unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Restarting configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-${CONFIG_NAME} \
restart
+28
View File
@@ -0,0 +1,28 @@
#! /bin/bash
# Stop the running opensimulator
BASE=$(pwd)
export CONFIG_NAME=${CONFIG_NAME:-standalone}
# This export fakes out the environment setup script to look for files in
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
source config/scripts/setEnvironment.sh
unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Restarting configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-${CONFIG_NAME} \
restart -t 10 opensim
+10 -5
View File
@@ -33,15 +33,18 @@ export CONFIG_NAME=${CONFIG_NAME:-standalone}
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
# set all environment variables
echo "Setting environemtn vars"
source config/scripts/setEnvironment.sh
# echo "================================"
# env | sort
# echo "================================"
# if configuration files are external to the container, run the configuration
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
echo "opensim-docker: running configuration file initialization"
config/scripts/updateConfigFiles.sh
config/scripts/linkInConfigs.sh
else
echo "opensim-docker: delaying configuration file initialization to configuration start"
# Just set the configuration variables into the environment
source config/scripts/setEnvironment.sh
fi
# Use the generic docker-compose file or the one specific to the configuration if it exists
@@ -51,11 +54,13 @@ if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Docker-compose file: ${COMPOSEFILE}"
# Local directory for storage of sql persistant data (so region
# contents persists between container restarts).
# This must be the same directory as in config-$CONFIG_NAME/docker-compose.yml.
if [[ ! -d "$HOME/opensim-sql-data" ]] ; then
echo "Directory \"$HOME\opensim-sql-data\" does not exist. Creating same."
mkdir -p "$HOME/opensim-sql-data"
chmod o+w "$HOME/opensim-sql-data"
fi
@@ -64,7 +69,7 @@ fi
# --userns-remap="opensim:opensim"
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-herbal3d \
--project-name opensim-${CONFIG_NAME} \
--project-directory "$BASE" \
up \
--detach
+5 -4
View File
@@ -13,14 +13,15 @@ unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE=./docker-compose.yml
if [[ -e "config/config-${CONFIG_NAME}/docker-compose.yml" ]] ; then
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Stopping configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-standalone \
--project-name opensim-${CONFIG_NAME} \
down
@@ -32,8 +32,8 @@ fi
echo "opensim-docker: updateConfigFiles.sh: replacing vars in \"${CONFIGDIR}/misc.ini\""
# If the replacement has already happened, this is a NOOP
sed --in-place \
-e "s/MYSQL_DB_USER/$MYSQL_DB_USER/" \
-e "s/MYSQL_DB_USER_PASSWORD/$MYSQL_DB_USER_PASSWORD/" \
-e "s/MYSQL_DB_USER/$MYSQL_DB_USER/" \
-e "s/MYSQL_DB_SOURCE/$MYSQL_DB_SOURCE/" \
-e "s/MYSQL_DB_DB/$MYSQL_DB_DB/" \
-e "s/PW_FOR_DEFAULT_ESTATE_OWNER/$PW_FOR_DEFAULT_ESTATE_OWNER/" \
+20
View File
@@ -0,0 +1,20 @@
#! /bin/bash
# Push the local image named "opensim-opensim" to the repository.
# The image tag is set to "latest".
# The repository image name can be over-ridden with the environment variable REPO_IMAGE.
export DOCKER_REPOSITORY=${DOCKER_REPOSITORY:-misterblue}
export IMAGE_NAME=${IMAGE_NAME:-opensim-opensim}
export IMAGE_VERSION=${IMAGE_VERSION:-latest}
VERSIONLABEL=$(docker run --rm --entrypoint /home/opensim/getVersion.sh opensim-opensim VERSION_TAG)
echo "Pushing docker image for opensim version ${VERSIONLABEL}"
for tagg in ${VERSIONLABEL} ${IMAGE_VERSION} ; do
IMAGE=${DOCKER_REPOSITORY}/${IMAGE_NAME}:${tagg}
docker tag ${IMAGE_NAME} ${IMAGE}
echo " Pushing ${IMAGE}"
docker push ${IMAGE}
done
+28
View File
@@ -0,0 +1,28 @@
#! /bin/bash
# Stop the running opensimulator
BASE=$(pwd)
export CONFIG_NAME=${CONFIG_NAME:-standalone}
# This export fakes out the environment setup script to look for files in
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
source config/scripts/setEnvironment.sh
unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Restarting configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-${CONFIG_NAME} \
restart
+13 -6
View File
@@ -1,5 +1,5 @@
#! /bin/bash
# Run the default Docker image using the standalone configuration.
# Run the OpenSimulator image
# Since the initial run has to create and initialize the MYSQL database
# the first time, this sets the passwords into the environment before
@@ -33,15 +33,18 @@ export CONFIG_NAME=${CONFIG_NAME:-standalone}
# build environment rather than in run environment.
export OPENSIMBIN=$BASE
# set all environment variables
echo "Setting environment vars"
source config/scripts/setEnvironment.sh
# echo "================================"
# env | sort
# echo "================================"
# if configuration files are external to the container, run the configuration
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
echo "opensim-docker: running configuration file initialization"
config/scripts/updateConfigFiles.sh
config/scripts/linkInConfigs.sh
else
echo "opensim-docker: delaying configuration file initialization to configuration start"
# Just set the configuration variables into the environment
source config/scripts/setEnvironment.sh
fi
# Use the generic docker-compose file or the one specific to the configuration if it exists
@@ -51,18 +54,22 @@ if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Docker-compose file: ${COMPOSEFILE}"
# Local directory for storage of sql persistant data (so region
# contents persists between container restarts).
# This must be the same directory as in config-$CONFIG_NAME/docker-compose.yml.
if [[ ! -d "$HOME/opensim-sql-data" ]] ; then
echo "Directory \"$HOME/opensim-sql-data/\" does not exist. Creating same."
mkdir -p "$HOME/opensim-sql-data"
chmod o+w "$HOME/opensim-sql-data"
fi
# https://docs.docker.com/engine/security/userns-remap/
# --userns-remap="opensim:opensim"
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-standalone \
--project-name opensim-${CONFIG_NAME} \
--project-directory "$BASE" \
up \
--detach
+5 -4
View File
@@ -13,14 +13,15 @@ unset OPENSIMBIN
# Use the generic docker-compose file or the one specific to the configuration if it exists
cd "$BASE"
COMPOSEFILE=./docker-compose.yml
if [[ -e "config/config-${CONFIG_NAME}/docker-compose.yml" ]] ; then
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml"
if [[ -z "$OS_DOCKER_CONTAINER_CONFIG" ]] ; then
# if using external configuration, include docker-compose with the mount
COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose-external-config.yml"
fi
echo "Stopping configuration $CONFIG_NAME from \"$COMPOSEFILE\""
docker-compose \
--file "$COMPOSEFILE" \
--project-name opensim-standalone \
--project-name opensim-${CONFIG_NAME} \
down