Conversation
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
|
ci-test |
|
ci-test build report: |
deploy/openshift/deploy_che.sh
Outdated
| printInfo "Templates have been successfully saved to ${BASE_DIR}/templates" | ||
| fi | ||
| else printInfo "Templates directory found at ${BASE_DIR}/templates. Applying templates from this directory. Delete it to get the latest templates if necessary" | ||
| fi |
There was a problem hiding this comment.
Looks like the formatting is a bit broken. Please consider reformatting:
getTemplates(){
if [ ! -d "${BASE_DIR}/templates" ]; then
printInfo "Local templates directory not found. Downloading templates..."
curl -s https://codeload.github.com/eclipse/che/tar.gz/master | tar -xz --strip=3 che-master/deploy/openshift/templates -C ${BASE_DIR}
OUT=$?
if [ ${OUT} -eq 1 ]; then
printError "Failed to curl and untar Eclipse Che repo because of an error"
printInfo "You may need to manually clone or download content of https://github.com/eclipse/che/tree/master/deploy/openshift and re-run the script"
exit ${OUT}
else
printInfo "Templates have been successfully saved to ${BASE_DIR}/templates"
fi
else
printInfo "Templates directory found at ${BASE_DIR}/templates. Applying templates from this directory. Delete it to get the latest templates if necessary"
fi
}
deploy/openshift/ocp.sh
Outdated
| download_oc | ||
| else | ||
| # here we check is installed version is same version defined in script, if not we update version to one that defined in script. | ||
| if [[ $($OC_BINARY version 2> /dev/null | grep "oc v" | cut -d " " -f2 | cut -d '+' -f1 || true) != *"$OC_VERSION"* ]]; then |
There was a problem hiding this comment.
Consider using tools for formatting.
The following is right here:
if [[ $(oc version 2> /dev/null | grep "oc v" | cut -d " " -f2 | cut -d '+' -f1 || true) == *"$OC_VERSION"* ]]; then
echo "Found oc ${OC_VERSION} in PATH. Using it"
export OC_BINARY="oc"
elif [[ ! -f $OC_BINARY ]]; then
download_oc
else
# here we check is installed version is same version defined in script, if not we update version to one that defined in script.
if [[ $($OC_BINARY version 2> /dev/null | grep "oc v" | cut -d " " -f2 | cut -d '+' -f1 || true) != *"$OC_VERSION"* ]]; then
rm -f "$OC_BINARY" "$OCP_TOOLS_DIR"/README.md "$OCP_TOOLS_DIR"/LICENSE
download_oc
fi
fi
deploy/openshift/deploy_che.sh
Outdated
| printInfo "Local templates directory not found. Downloading templates..." | ||
| curl -s https://codeload.github.com/eclipse/che/tar.gz/master | tar -xz --strip=3 che-master/deploy/openshift/templates -C ${BASE_DIR} | ||
| OUT=$? | ||
| if [ ${OUT} -eq 1 ]; then |
There was a problem hiding this comment.
It might be better to check for non zero return code as there are other error code other than 1
* Multiple changes to deploy scripts * Remove debug echo * Fix formatting * Fix formatting * Fixup
What does this PR do?
deploy_che.shautonomous, ie the script can download templates without the need for a user to clone the entire repo. Once merged this script will be the default way to deploy Che to OpenShift in official documentation.deploy_che.sh. Usingjqand parsing statuses isn't the right way to go. Instead, waiting for deployment replica is a foolproof way. It uses less code, and this approach is used in Ansible playbooks when waiting for a deploymentjqindeploy_che.shsince wait functions use-o=jsonpathrather than jq now, which is a true oc way.jqinocp.sh- the only function it was used in was the function that waited for ocp full boot. We do not use an internal docker registry in Origin at all during Che deployment. I'd say it's a legacy function since we indeed useds2ifor Che multiuser (not anymore)ocbinary of the right version is present inPATH- downloading archives from GitHub takes time