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

SAAS-101 : Allow cli inheritance without dockerfiles manifests #3691

Merged
merged 1 commit into from
Jan 16, 2017
Merged
Show file tree
Hide file tree
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
18 changes: 14 additions & 4 deletions dockerfiles/base/scripts/base/commands/cmd_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,19 @@ generate_configuration_with_puppet() {

if local_repo; then
CHE_REPO="on"
WRITE_PARAMETERS="-v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/manifests\":/etc/puppet/manifests:ro \
-v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/modules\":/etc/puppet/modules:ro \
-e \"CHE_ASSEMBLY=${CHE_ASSEMBLY}\""
WRITE_PARAMETERS=" -e \"CHE_ASSEMBLY=${CHE_ASSEMBLY}\""
# add local mounts only if they are present
if [ -d "/repo/dockerfiles/init/manifests" ]; then
WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/manifests\":/etc/puppet/manifests:ro"
fi
if [ -d "/repo/dockerfiles/init/modules" ]; then
WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/modules\":/etc/puppet/modules:ro"
fi
# Handle override/addon
if [ -d "/repo/dockerfiles/init/addon" ]; then
WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/addon/addon.pp\":/etc/puppet/manifests/addon.pp:ro"
fi

else
CHE_REPO="off"
WRITE_PARAMETERS=""
Expand All @@ -125,7 +135,7 @@ generate_configuration_with_puppet() {
$IMAGE_INIT \
apply --modulepath \
/etc/puppet/modules/ \
/etc/puppet/manifests/${CHE_MINI_PRODUCT_NAME}.pp --show_diff ${WRITE_LOGS}"
/etc/puppet/manifests/ --show_diff ${WRITE_LOGS}"

log ${GENERATE_CONFIG_COMMAND}
eval ${GENERATE_CONFIG_COMMAND}
Expand Down
12 changes: 6 additions & 6 deletions dockerfiles/base/scripts/base/commands/cmd_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ cmd_init() {
fi

# in development mode we use init files from repo otherwise we use it from docker image
INIT_RUN_PARAMETERS=""
if local_repo; then
docker_run -v "${CHE_HOST_CONFIG}":/copy \
-v "${CHE_HOST_DEVELOPMENT_REPO}"/dockerfiles/init:/files \
-v "${CHE_HOST_DEVELOPMENT_REPO}"/dockerfiles/init/manifests/${CHE_MINI_PRODUCT_NAME}.env:/etc/puppet/manifests/${CHE_MINI_PRODUCT_NAME}.env \
$IMAGE_INIT
else
docker_run -v "${CHE_HOST_CONFIG}":/copy $IMAGE_INIT
if [ -d "/repo/dockerfiles/init/manifests" ]; then
INIT_RUN_PARAMETERS=" -v "${CHE_HOST_DEVELOPMENT_REPO}"/dockerfiles/init:/files"
INIT_RUN_PARAMETERS+=" -v "${CHE_HOST_DEVELOPMENT_REPO}"/dockerfiles/init/manifests/${CHE_MINI_PRODUCT_NAME}.env:/etc/puppet/manifests/${CHE_MINI_PRODUCT_NAME}.env"
fi
fi
docker_run -v "${CHE_HOST_CONFIG}":/copy $INIT_RUN_PARAMETERS $IMAGE_INIT

# If this is is a reinit, we should not overwrite these core template files.
# If this is an initial init, then we have to override some values
Expand Down