Commit 9aa00d65 authored by Marian Heil's avatar Marian Heil

Removed redundant exits & updated install scripts

parent 2d24534b
......@@ -30,29 +30,29 @@ cd build
cp ../Docker_template ${TARGET_DOCKER}
# setup target
sed -i -e "s TEMPLATE_PREFIX ${TARGET_PREFIX} g" ${TARGET_DOCKER} | exit 2
sed -i -e "s TEMPLATE_NAME ${TARGET_NAME} g" ${TARGET_DOCKER} | exit 2
sed -i -e "s TEMPLATE_BASEDIR ${HEPSW_HOME} g" ${TARGET_DOCKER} | exit 2
sed -i -e "s TEMPLATE_PREFIX ${TARGET_PREFIX} g" ${TARGET_DOCKER}
sed -i -e "s TEMPLATE_NAME ${TARGET_NAME} g" ${TARGET_DOCKER}
sed -i -e "s TEMPLATE_BASEDIR ${HEPSW_HOME} g" ${TARGET_DOCKER}
echo "- Installation directory is set to ${HEPSW_HOME}"
# set base
if [[ ${BASE_NAME} == "compiler" ]]; then
base_docker=$(image_name "compiler")
sed -i -e "s0#SOURCE0RUN printf \"\#! /usr/bin/env bash\\\n\" > HEJ_env.sh\n#SOURCE0g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
else
declare -n dep_dir=HEPSW_${BASE_NAME^^}_DIR
declare -n dep_name=HEPSW_${BASE_NAME^^}_NAME
base_docker=$(image_name ${BASE_NAME})
if [[ ${dep_dir} != "" ]]; then
sed -i -e "s#SOURCE#SOURCE\nRUN printf \"source ${dep_dir}/${dep_name}dependencies.sh\\\n\" >> HEJ_env.sh#g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
sed -i -e "s#SOURCE#SOURCE\nRUN printf \"source ${dep_dir}/${dep_name}env.sh\\\n\" >> HEJ_env.sh#g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
fi
fi
echo "- Using \"${base_docker}\" as base docker"
sed -i -e "s TEMPLATE_BASE ${base_docker} g" ${TARGET_DOCKER} | exit 2
sed -i -e "s TEMPLATE_BASE ${base_docker} g" ${TARGET_DOCKER}
# add sources
# TODO this is a lazy we don't add the "dependencies of dependencies"
......@@ -62,11 +62,11 @@ for dep in ${SOURCE_IMAGES[@]}; do
dep_docker=$(image_name ${dep_name})
echo "- Adding target \"${dep_docker}\""
sed -i -e "s#SOURCE#SOURCE\nRUN printf \"source ${dep_dir}/${dep_name}dependencies.sh\\\n\" >> HEJ_env.sh#g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
sed -i -e "s#SOURCE#SOURCE\nRUN printf \"source ${dep_dir}/${dep_name}env.sh\\\n\" >> HEJ_env.sh#g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
sed -i -e "s#IMAGES#IMAGES\nCOPY --from=${dep_docker} ${dep_dir} ${dep_dir}#g" \
${TARGET_DOCKER} | exit 2
${TARGET_DOCKER}
done
echo "- Success! To build the docker run:
......
Subproject commit b8617c3fbb977fe614d7897a48b89125e65b95c4
Subproject commit 906a2c0af3df96dd27bbadee93edbb23347ec76c
......@@ -30,10 +30,10 @@ mkdir -p build
cd build
cp ../Docker_generic ${MODULE_DOCKER}
sed -i -e "s TEMPLATE_PREFIX ${MODULE_PREFIX} g" ${MODULE_DOCKER} | exit 2
sed -i -e "s TEMPLATE_FOLDER ${MODULE_DIR} g" ${MODULE_DOCKER} | exit 2
sed -i -e "s TEMPLATE_NAME ${MODULE_NAME} g" ${MODULE_DOCKER} | exit 2
sed -i -e "s TEMPLATE_HEPSW_HOME ${HEPSW_HOME} g" ${MODULE_DOCKER} | exit 2
sed -i -e "s TEMPLATE_PREFIX ${MODULE_PREFIX} g" ${MODULE_DOCKER}
sed -i -e "s TEMPLATE_FOLDER ${MODULE_DIR} g" ${MODULE_DOCKER}
sed -i -e "s TEMPLATE_NAME ${MODULE_NAME} g" ${MODULE_DOCKER}
sed -i -e "s TEMPLATE_HEPSW_HOME ${HEPSW_HOME} g" ${MODULE_DOCKER}
echo "- Installation directory is set to ${HEPSW_HOME}"
if [[ ${#MODULE_DEPENDENCIES[@]} -gt 0 ]]; then
......@@ -43,14 +43,14 @@ else
base_docker=$(image_name "compiler")
fi
echo "- Using \"${base_docker}\" as base docker"
sed -i -e "s TEMPLATE_BASE ${base_docker} g" ${MODULE_DOCKER} | exit 2
sed -i -e "s TEMPLATE_BASE ${base_docker} g" ${MODULE_DOCKER}
for dep in ${MODULE_DEPENDENCIES[@]:1}; do
declare -n dep_dir=HEPSW_${dep}_DIR
declare -n dep_name=HEPSW_${dep}_NAME
dep_docker=$(image_name ${dep_name})
echo "- Adding additional dependency \"${dep_docker}\""
sed -i -e "s#DEPENDENCIES#DEPENDENCIES\nCOPY --from=${dep_docker} ${dep_dir} ${dep_dir}#g" ${MODULE_DOCKER} | exit 2
sed -i -e "s#DEPENDENCIES#DEPENDENCIES\nCOPY --from=${dep_docker} ${dep_dir} ${dep_dir}#g" ${MODULE_DOCKER}
done
echo "- Success! To build the docker run:
......
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