Commit 6d30dcb1 authored by Yori Fournier's avatar Yori Fournier
Browse files

finishing reforge of run_step.sh

parent fb1b9670
......@@ -38,30 +38,30 @@ touch ${TMP_DIR}/parameters_checksum.sha1
# set the BUILD HASH
set_build_hash ${STEP_NAME} ${COMMIT}
echo "build_hash = \"${BUILD_HASH}\"" # >> ${TMP_DIR}/trace.toml
echo "build_hash = \"${BUILD_HASH}\"" >> ${TMP_DIR}/trace.toml
# set the PARAM HASH
set_param_hash ${STEP_NAME} ${TMP_DIR}
echo "parameters_hash = \"${PARAM_HASH}\"" # >> ${TMP_DIR}/trace.toml
echo "parameters_hash = \"${PARAM_HASH}\"" >> ${TMP_DIR}/trace.toml
# Set the ARCHIVES HASH
set_archives_hash ${STEP_NAME} ${TMP_DIR}
echo "archives_hash = \"${ARCHIVES_HASH}\"" # >> ${TMP_DIR}/trace.toml
echo "archives_hash = \"${ARCHIVES_HASH}\"" >> ${TMP_DIR}/trace.toml
# Set the STEP HASH
STEP_HASH_ID="$(get_hash_from_word ${BUILD_HASH})-$(get_hash_from_word ${PARAM_HASH})-$(get_hash_from_word ${ARCHIVES_HASH})"
STEP_HASH=$(gen_hash_word --seed=${STEP_HASH_ID})
echo "step_id = \"${STEP_HASH_ID}\"" # >> ${TMP_DIR}/trace.toml
echo "step_hash = \"${STEP_HASH}\"" # >> ${TMP_DIR}/trace.toml
echo "step_id = \"${STEP_HASH_ID}\"" >> ${TMP_DIR}/trace.toml
echo "step_hash = \"${STEP_HASH}\"" >> ${TMP_DIR}/trace.toml
# Set the DEPS_HASH
set_deps_hash ${TMP_DIR} ${DEPS_DIR[@]}
echo "dep_id = \"${DEPS_ID}\"" # >> ${TMP_DIR}/trace.toml
echo "deps_hash = \"${DEPS_HASH}\"" # >> ${TMP_DIR}/trace.toml
echo "dep_id = \"${DEPS_ID}\"" >> ${TMP_DIR}/trace.toml
echo "deps_hash = \"${DEPS_HASH}\"" >> ${TMP_DIR}/trace.toml
# Set TMP ARTIFACT HASH
ARTIFACT_HASH="00000000"
......@@ -75,7 +75,7 @@ STEP_DIR_NAME="${STEP_NAME}-${short_deps_hash}-${short_step_hash}"
echo "DIR NAME: ${STEP_DIR_NAME}"
#
# THIS SHOULD GO IN RUN_PIPELINE !!
# THIS SHOULD GO IN RUN_PIPELINE !! or be ignore by a --force option
#
# look in the artifacts directory if the step already exists
ls -d ${PIPE_ROOT}/${ARTIFACTS}/${STEP_DIR_NAME}* &> /dev/null
......@@ -107,13 +107,21 @@ fi;
# run the step if it does not exist
# ARTIFACT_HASH=$(gen_hash_word --seed ${STEP_DIR_NAME})
ARTIFACT_HASH=$(gen_hash_word)
echo "artifact_hash = \"${ARTIFACT_HASH}\"" # >> ${TMP_DIR}/trace.toml
ARTIFACT_HASH=$(gen_hash_word --seed ${STEP_DIR_NAME})
# ARTIFACT_HASH=$(gen_hash_word)
echo "artifact_hash = \"${ARTIFACT_HASH}\"" >> ${TMP_DIR}/trace.toml
# add the dependancies to the trace
cat ${TMP_DIR}/trace_deps.toml >> ${TMP_DIR}/trace.toml
# copy the parameters to the artifacts
mkdir ${TMP_DIR}/runtime-parameters
cp -r ${PIPE_ROOT}/${RUNTIME_PARAMS}/${STEP_NAME} ${TMP_DIR}/runtime-parameters
# copy the image to the artifacts
mkdir ${TMP_DIR}/docker-image
cp ${PIPE_ROOT}/${IMAGES_ARCH}/${STEP_NAME}_${COMMIT}.tar ${TMP_DIR}/docker-image/
# rename the folder with the artifact short-hash
short_deps_hash=$(get_short_hash_from_word ${DEPS_HASH})
short_step_hash=$(get_short_hash_from_word ${STEP_HASH})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment