-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow user to use local scripts and configuration files in lieu of generated when using openshift ocp.sh script. #8156
Changes from 6 commits
28f0f48
3257fd2
c28f8c8
eb1d541
f851c2a
405f09a
8717c36
75871ed
dd2a97c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,11 @@ export JQ_BINARY_DOWNLOAD_URL=${JQ_BINARY_DOWNLOAD_URL:-${DEFAULT_JQ_BINARY_DOWN | |
DEFAULT_CHE_MULTIUSER="false" | ||
export CHE_MULTIUSER=${CHE_MULTIUSER:-${DEFAULT_CHE_MULTIUSER}} | ||
|
||
#Using local scripts is error prone and should only be used temporarly while developing Che. | ||
#If unsure leave the default value true set. | ||
DEFAULT_CHE_GENERATE_SCRIPTS=true | ||
export CHE_GENERATE_SCRIPTS=${CHE_GENERATE_SCRIPTS:-${DEFAULT_CHE_REMOVE_PROJECT}} | ||
|
||
DEFAULT_OPENSHIFT_USERNAME="developer" | ||
export OPENSHIFT_USERNAME=${OPENSHIFT_USERNAME:-${DEFAULT_OPENSHIFT_USERNAME}} | ||
|
||
|
@@ -153,15 +158,27 @@ run_ocp() { | |
} | ||
|
||
deploy_che_to_ocp() { | ||
#Repull init image only if IMAGE_PULL_POLICY is set to Always | ||
if [ $IMAGE_PULL_POLICY == "Always" ]; then | ||
docker pull "$IMAGE_INIT" | ||
#Only generate scripts and config files if CHE_GENERATE_SCRIPTS=true | ||
if [ $CHE_GENERATE_SCRIPTS == true ]; then | ||
echo "OCP generating temporary scripts and configuration files at ${CONFIG_DIR}/instance/config/openshift/scripts/ ." | ||
#Repull init image only if IMAGE_PULL_POLICY is set to Always | ||
if [ $IMAGE_PULL_POLICY == "Always" ]; then | ||
docker pull "$IMAGE_INIT" | ||
fi | ||
#wipeout config folder | ||
docker run -v "${CONFIG_DIR}":/to_remove alpine sh -c "rm -rf /to_remove/" || true | ||
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" eclipse/che-cli:${CHE_IMAGE_TAG} config --skip:pull --skip:nightly | ||
cd "${CONFIG_DIR}/instance/config/openshift/scripts/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added variable OPENSHIFT_SCRIPTS_FOLDER. |
||
else | ||
echo "OCP using existing scripts in current folder." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous message contains information about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is shell scripts and yaml files needed to deploy che multi user There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
fi | ||
if [[ ! -f "deploy_che.sh" ]]; then | ||
CURRENT_PWD=$(pwd) | ||
echo "OCP script deploy_che.sh does not exist in ${CURRENT_PWD} ." | ||
exit 1 | ||
else | ||
bash deploy_che.sh ${DEPLOY_SCRIPT_ARGS} | ||
fi | ||
#wipeout config folder | ||
docker run -v "${CONFIG_DIR}":/to_remove alpine sh -c "rm -rf /to_remove/" || true | ||
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${CONFIG_DIR}":/data -e IMAGE_INIT="$IMAGE_INIT" -e CHE_MULTIUSER="$CHE_MULTIUSER" ${CHE_CLI_IMAGE} config --skip:pull --skip:nightly | ||
cd "${CONFIG_DIR}/instance/config/openshift/scripts/" | ||
bash deploy_che.sh ${DEPLOY_SCRIPT_ARGS} | ||
wait_until_server_is_booted | ||
if [ $CHE_MULTIUSER == true ]; then | ||
wait_until_kc_is_booted | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must be moved out from
if
statement because it should be considered in both casesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.