Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check cdmver before getting period #424

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions bin/base
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ function extract_primary_periods() {
RUN_DIR=${1}
shift

cdmver=`cat $CRUCIBLE_HOME/subprojects/core/CommonDataModel/VERSION`

if [ -e ${RUN_DIR} -a -d ${RUN_DIR} ]; then
json_files=$(find -L "${RUN_DIR}" -name primary-period.json)
if [ -n "${json_files}" ]; then
Expand Down Expand Up @@ -411,9 +413,14 @@ function extract_primary_periods() {
if [ -z "${SAMPLE_NUM}" -o ${SAMPLE_RC} != 0 ]; then
SAMPLE_RC=1
else
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"id\"'")
if [ "$cdmver" == "v7dev" ]; then
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"id\"'")
elif [ "$cdmver" == "v8dev" ]; then
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"period-uuid\"'")
else
exit_error "CommonDataModel version ($cdmver) is not supported, exiting"
fi
PRIMARY_PERIOD_RC=$?

if [ -z "${PRIMARY_PERIOD_ID}" -o ${PRIMARY_PERIOD_RC} != 0 ]; then
SAMPLE_RC=1
fi
Expand Down
Loading