-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Restructure to use ENV to pull in ASSIGN (#7)
- Loading branch information
Showing
2 changed files
with
39 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,37 @@ | ||
#!/bin/bash | ||
################################################################# | ||
# # | ||
# Copyright (c) 2024 YottaDB LLC and/or its subsidiaries. # | ||
# All rights reserved. # | ||
# # | ||
# This source code contains the intellectual property # | ||
# of its copyright holder(s), and is made available # | ||
# under a license. If you do not know the terms of # | ||
# the license, please stop and do not read further. # | ||
# # | ||
################################################################# | ||
|
||
mkdir -p /data/logs | ||
|
||
#set env vars | ||
export ydb_chset=M | ||
# Set env vars | ||
. /opt/yottadb/current/ydb_env_set | ||
|
||
#get ASSIGN | ||
read -p "Enter ASSIGN git repo url (https://github.com/endeavourhealth-discovery/ASSIGN.git):" assign_url | ||
assign_url=${assign_url:-"https://github.com/endeavourhealth-discovery/ASSIGN.git"} | ||
read -p "Enter ASSIGN install path (./ASSIGN):" assign_dest | ||
assign_dest=${assign_dest:-"./ASSIGN"} | ||
read -p "Enter ASSIGN commit sha ( ):" sha | ||
sha=${sha:-""} | ||
assign_url="https://github.com/endeavourhealth-discovery/ASSIGN.git" | ||
assign_dest="./ASSIGN" | ||
sha="" | ||
git clone $assign_url $assign_dest | ||
git -C $assign_dest checkout $sha | ||
cp $assign_dest/UPRN/yottadb/* $ydb_dir/$ydb_rel/r | ||
mkdir ./ABP | ||
cp $assign_dest/UPRN/codelists/* /data/ABP | ||
|
||
#perform zlink of routines | ||
$ydb_dist/ydb -run ^ZLINK | ||
|
||
# extend database to hold ABP | ||
# Get ASSIGN | ||
if [ ! -d "$assign_dest" ]; then | ||
echo "Obtaining ASSIGN routines." | ||
# Clone the wanted sha from github | ||
git clone $assign_url $assign_dest | ||
git -C $assign_dest checkout $assign_sha | ||
|
||
# Put the routines to the YottaDB routines directory | ||
echo "Moving the routines." | ||
cp $assign_dest/UPRN/yottadb/* $ydb_dir/$ydb_rel/r | ||
cp $assign_dest/UPRN/codelists/* $abp_dir | ||
|
||
# Perform zlink of routines | ||
echo "Linking ASSIGN routines." | ||
$ydb_dist/ydb -run ^ZLINK | ||
else | ||
echo "$assign_dest already exists. Not cloning down ASSIGN again." | ||
fi | ||
|
||
# Update YottaDB database settings | ||
$ydb_dist/mupip set -NULL_SUBSCRIPTS=true -region DEFAULT && \ | ||
$ydb_dist/mupip set -journal=off -region DEFAULT && \ | ||
$ydb_dist/mupip set -extension_count=500000 -region DEFAULT && \ | ||
$ydb_dist/mupip set -access_method=mm -region DEFAULT | ||
$ydb_dist/mupip extend DEFAULT -blocks=1700 | ||
|
||
#startup webgui | ||
yottadb -run %ydbgui --readwrite --port 9080 >>/data/logs/%ydbgui.log & | ||
|
||
#load in ABP straight away, we don't do this at the moment as it takes a long time and still has issues with encoding on codelist files. | ||
#$ydb_dist/ydb -run %XCMD 'd IMPORT^UPRN1A("/data/ABP")' | ||
# Startup webgui | ||
yottadb -run %ydbgui --read --port 9080 >>/data/logs/%ydbgui.log & | ||
|
||
#drop in to ydb | ||
# Drop in to ydb | ||
exec $ydb_dist/yottadb -direct |