<commit_before>#!/usr/bin/env bash
#
# Copyright 2018 B2i Healthcare Pte Ltd, http://b2i.sg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Snow Owl terminology server deploy script
# See usage or execute the script with the -h flag to get further information.
#
# Version: 2.0
#

# Determines where the server needs to be deployed, default is /opt/snowowl
DEPLOYMENT_FOLDER="/opt/snowowl"

# The server archive path that needs to be deployed
SERVER_ARCHIVE_PATH=""

# The dataset archive path that needs to be deployed
DATASET_ARCHIVE_PATH=""

# The path to Snow Owl's config file to override the default
SNOWOWL_CONFIG_PATH=""

# MySQL user with database creation privileges
MYSQL_USERNAME=""

# Password for MySQL user with database creation privileges
MYSQL_PASSWORD=""

# Global path to server deployments
GENERIC_SERVER_PATH=""

# Path to the latest server folder
LATEST_SERVER_SYMLINK_PATH=""

# Variable to store the path of the newly installed server
SERVER_PATH=""

# The containing folder of the server within the provided archive
SERVER_PATH_WITHIN_ARCHIVE=""

# Variable used for storing the currently running Snow Owl server's path
RUNNING_SERVER_PATH=""

# SHA1 checksum of the existing server
EXISTING_SERVER_SHA1=""

# Path to the SHA1 checksum of the current server
EXISTING_SERVER_SHA1_PATH=""

# SHA1 checksum of the incoming server
INCOMING_SERVER_SHA1=""

# Global path to resources: indexes, defaults, snomedicons
GENERIC_RESOURCES_PATH=""

# The containing folder of the indexes within the provided dataset archive
INDEXES_FOLDER_WITHIN_ARCHIVE=""

# The containing folder of the SQL files within the provided dataset archive
SQL_FOLDER_WITHIN_ARCHIVE=""

# SHA1 checksum of the existing dataset
EXISTING_DATASET_SHA1=""

# Path to the SHA1 checksum of the current dataset
EXISTING_DATASET_SHA1_PATH=""

# SHA1 checksum of the incoming dataset
INCOMING_DATASET_SHA1=""

# Flag to indicate if the dataset needs to be reloaded regardless of the existing SHA1 checksum
FORCE_RELOAD="false"

# Global path to logs
GENERIC_LOG_PATH=""

# The number of retries to wait for e.g. server startup, shutdown or log file creation
RETRIES=300

# The number of seconds to wait between retries
RETRY_WAIT_SECONDS=1

# The default MySQL username for the Snow Owl terminology server
SNOWOWL_MYSQL_USERNAME=""

# The default MySQL password for the Snow Owl terminology server
SNOWOWL_MYSQL_PASSWORD=""

# The anchor file in a server archive which is always in the root of the server folder. This is
# used for identifying the server folder inside an archive with subfolders.
SERVER_ANCHOR_FILE="snowowl_config.yml"

# The indexes anchor folder in a dataset archive.
# This is used for identifying the index folder inside an archive with subfolders.
INDEXES_ANCHOR="indexes"

# The anchor file for SQL files.
# This is used for identifying the folder which contains the SQL files inside an archive with subfolders.
SQL_ANCHOR="snomedStore.sql"

# The anchor for identifying the H2 store folder inside a datatset archive
H2_ANCHOR="snomedStore.h2.db"

# Path to the users file which contains file based authentication info
AUTHENTICATION_FILE_PATH=""

# The base URL of the REST services to use
BASE_URL="http://localhost:8080/snowowl"

# The base URL for administrative services
ADMIN_BASE_URL="$BASE_URL/admin"

# The general info REST endpoint which also provides the list of available repositories
INFO_URL="$ADMIN_BASE_URL/info"

# The starting directory
INITIAL_PWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Variable to determine the local MySQL instance
MYSQL=$(which mysql)

# List of all known database names used by the Snow Owl terminology server
DATABASES=(atcStore icd10Store icd10amStore icd10cmStore icd10ukStore lcsStore
	loincStore mappingsetStore nicipStore opcsStore sddStore snomedStore umlsStore valuesetStore)

# The hostname of the server running Snow Owl, used for MySQL access control
SNOWOWL_HOST="localhost"

# Enviromental variable used by Jenkins
export BUILD_ID=dontKillMe

usage() {

	cat <<EOF
NAME:

	Snow Owl terminology server deploy script

OPTIONS:<commit_msg>[deploy] Set java home for 6.x deployments<commit_after>#!/usr/bin/env bash
#
# Copyright 2018 B2i Healthcare Pte Ltd, http://b2i.sg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Snow Owl terminology server deploy script
# See usage or execute the script with the -h flag to get further information.
#
# Version: 2.0
#

# Determines where the server needs to be deployed, default is /opt/snowowl
DEPLOYMENT_FOLDER="/opt/snowowl"

# The server archive path that needs to be deployed
SERVER_ARCHIVE_PATH=""

# The dataset archive path that needs to be deployed
DATASET_ARCHIVE_PATH=""

# The path to Snow Owl's config file to override the default
SNOWOWL_CONFIG_PATH=""

# MySQL user with database creation privileges
MYSQL_USERNAME=""

# Password for MySQL user with database creation privileges
MYSQL_PASSWORD=""

# Global path to server deployments
GENERIC_SERVER_PATH=""

# Path to the latest server folder
LATEST_SERVER_SYMLINK_PATH=""

# Variable to store the path of the newly installed server
SERVER_PATH=""

# The containing folder of the server within the provided archive
SERVER_PATH_WITHIN_ARCHIVE=""

# Variable used for storing the currently running Snow Owl server's path
RUNNING_SERVER_PATH=""

# SHA1 checksum of the existing server
EXISTING_SERVER_SHA1=""

# Path to the SHA1 checksum of the current server
EXISTING_SERVER_SHA1_PATH=""

# SHA1 checksum of the incoming server
INCOMING_SERVER_SHA1=""

# Global path to resources: indexes, defaults, snomedicons
GENERIC_RESOURCES_PATH=""

# The containing folder of the indexes within the provided dataset archive
INDEXES_FOLDER_WITHIN_ARCHIVE=""

# The containing folder of the SQL files within the provided dataset archive
SQL_FOLDER_WITHIN_ARCHIVE=""

# SHA1 checksum of the existing dataset
EXISTING_DATASET_SHA1=""

# Path to the SHA1 checksum of the current dataset
EXISTING_DATASET_SHA1_PATH=""

# SHA1 checksum of the incoming dataset
INCOMING_DATASET_SHA1=""

# Flag to indicate if the dataset needs to be reloaded regardless of the existing SHA1 checksum
FORCE_RELOAD="false"

# Global path to logs
GENERIC_LOG_PATH=""

# The number of retries to wait for e.g. server startup, shutdown or log file creation
RETRIES=300

# The number of seconds to wait between retries
RETRY_WAIT_SECONDS=1

# The default MySQL username for the Snow Owl terminology server
SNOWOWL_MYSQL_USERNAME=""

# The default MySQL password for the Snow Owl terminology server
SNOWOWL_MYSQL_PASSWORD=""

# The anchor file in a server archive which is always in the root of the server folder. This is
# used for identifying the server folder inside an archive with subfolders.
SERVER_ANCHOR_FILE="snowowl_config.yml"

# The indexes anchor folder in a dataset archive.
# This is used for identifying the index folder inside an archive with subfolders.
INDEXES_ANCHOR="indexes"

# The anchor file for SQL files.
# This is used for identifying the folder which contains the SQL files inside an archive with subfolders.
SQL_ANCHOR="snomedStore.sql"

# The anchor for identifying the H2 store folder inside a datatset archive
H2_ANCHOR="snomedStore.h2.db"

# Path to the users file which contains file based authentication info
AUTHENTICATION_FILE_PATH=""

# The base URL of the REST services to use
BASE_URL="http://localhost:8080/snowowl"

# The base URL for administrative services
ADMIN_BASE_URL="$BASE_URL/admin"

# The general info REST endpoint which also provides the list of available repositories
INFO_URL="$ADMIN_BASE_URL/info"

# The starting directory
INITIAL_PWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Variable to determine the local MySQL instance
MYSQL=$(which mysql)

# List of all known database names used by the Snow Owl terminology server
DATABASES=(atcStore icd10Store icd10amStore icd10cmStore icd10ukStore lcsStore
	loincStore mappingsetStore nicipStore opcsStore sddStore snomedStore umlsStore valuesetStore)

# The hostname of the server running Snow Owl, used for MySQL access control
SNOWOWL_HOST="localhost"

# Enviromental variable used by Jenkins

export BUILD_ID=dontKillMe

export JAVA_HOME=/opt/jdk-8

usage() {

	cat <<EOF
NAME:

	Snow Owl terminology server deploy script

OPTIONS:
{'fraction_non_alphanumeric': 0.05951996555806695, 'fraction_numerical': 0.00990205575287913, 'mean_word_length': 5.2826233941852605, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5126978', 'n_tokens_mistral': 2765, 'n_tokens_neox': 2651, 'n_words': 1155}