Skip to content

Commit

Permalink
Allow load project script to receive parameteres
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Aug 2, 2023
1 parent 5262d6a commit cf0eace
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions source/load-rowan-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,34 @@

set -e

if [ -z "${GS64_CI_PROJECT_NAME}" ]; then
if [ -n "$1" ]; then
readonly LRP_PROJECT_NAME=$1
elif [ -z "${GS64_CI_PROJECT_NAME}" ]; then
echo "[ERROR] Missing GS64_CI_PROJECT_NAME variable"
exit 1
else
readonly LRP_PROJECT_NAME="${GS64_CI_PROJECT_NAME}"
fi

if [ -n "$2" ]; then
readonly LRP_LOAD_SPEC=$2
else
readonly LRP_LOAD_SPEC="${GS64_CI_SPEC:-${LRP_PROJECT_NAME}-CI}"
fi

readonly LOAD_SPEC="${GS64_CI_SPEC:-${GS64_CI_PROJECT_NAME}-CI}"
readonly SYSTEM_USER_PASSWORD="${GS64_CI_SYSTEM_USER_PASSWORD:-swordfish}"

echo "Loading code in GS..."
echo " Project Name: ${GS64_CI_PROJECT_NAME}"
echo " Load Spec: ${LOAD_SPEC}"
echo " Project Name: ${LRP_PROJECT_NAME}"
echo " Load Spec: ${LRP_LOAD_SPEC}"

topaz -i -q <<EOF > "${GEMSTONE_LOG_DIR}/loading-rowan-projects.log"
set gemstone gs64stone user SystemUser pass ${SYSTEM_USER_PASSWORD}
iferror exit 1
login
doit
|spec url |
url := 'file://${ROWAN_PROJECTS_HOME}/${GS64_CI_PROJECT_NAME}/rowan/specs/${LOAD_SPEC}.ston'.
url := 'file://${ROWAN_PROJECTS_HOME}/${LRP_PROJECT_NAME}/rowan/specs/${LRP_LOAD_SPEC}.ston'.
spec := RwSpecification fromUrl: url.
spec resolve load.
%
Expand Down

0 comments on commit cf0eace

Please sign in to comment.