- Git LFS is used to store with the application the JSON data ready to be loaded in elasticsearch. If you clone the repository without installing git LFS, the data will not be cloned. To get the JSON data, you must install git LFS (look at [how to install](https://git-lfs.github.com/)).
- Another dedicated Git LFS project (internal only) will be created to handle all private + public JSON files
-**TODO**: refer to the good Git LFS project in the CI settings for indexing the relevant data into the relevant Elasticsearch indices/instances
- the JSON files generation is handled by an external ET (extract/transform) tool.
- the JSON files generation is handled by an external ET (extract/transform) tool, only per-app suggestions are generated here using `./scripts/createSuggestions.sh`.
@@ -170,6 +171,12 @@ by these tests. The documentation is generated in the folder `backend/build/asci
## Harvest
Before all, if you've cloned the repository with git LFS data skipped (see [Data handling](#data-handling) section), take care to fetch the relevant data before running any indexing script.
### Portability
Feedback related to portability on MacOS and other GNU/Linux distro is really welcomed. For MacOS, care to use latest GNU Parallel and Bash v4 versions, not the version provided by default via Brew.
Harvesting (i.e. importing JSON documents into Elasticsearch) consists in creating the necessary index and aliases and Elasticsearch templates.
To create the index and its aliases execute the script below for local dev environment:
PREVIOUS_TIMESTAMP=$(curl -s"${ES_HOST}:${ES_PORT}/_cat/indices/${APP_NAME}*${APP_ENV}-tmstp*" | sed-r"s/.*-tmstp([0-9]+).*/\1/g" | sort-ru | head-1)# no index yet created with current timestamp. So using the latest as previous timestamp.
# Create index, aliases with their mapping
sh ${BASEDIR}/createIndexAndAliases4CI.sh -host"$ES_HOST"-port"$ES_PORT"-app"$APP_NAME"-env"$APP_ENV"-timestamp"$TIMESTAMP"
sh "${BASEDIR}"/createIndexAndAliases4CI.sh -host"$ES_HOST"-port"$ES_PORT"-app"$APP_NAME"-env"$APP_ENV"-timestamp"$TIMESTAMP"
CODE=$?
[$CODE-gt 0 ]&&{echo-e"${RED_BOLD}Error when creating index, see errors above. Exiting.${NC}";exit$CODE;}
#exit 0
echo
# Does index data in created indices
sh ${BASEDIR}/harvestCI.sh -host"$ES_HOSTS"-port"$ES_PORT"-app"$APP_NAME"-env"$APP_ENV"-timestamp"$TIMESTAMP"
if["1"-eq"${INDEX}"];then
sh "${BASEDIR}"/harvestCI.sh -host"$ES_HOSTS"-port"$ES_PORT"-app"$APP_NAME"-env"$APP_ENV"-timestamp"$TIMESTAMP"
fi
CODE=$?
[$CODE-gt 0 ]&&{echo-e"${RED_BOLD}Error when indexing data, see errors above. Exiting.${NC}";exit$CODE;}