diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ba6bf018..17928037e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Fix CI/CD problems in Jenkins pipelines ([#1177](https://github.com/opendevstack/ods-core/pull/1177)) - Fixes Python agent does not seems to have java in the path ([#685](https://github.com/opendevstack/ods-quickstarters/issues/685)) - Removes existing differences between jenkins agent base image in Centos 7 and UBI 8 ([#1181](https://github.com/opendevstack/ods-core/pull/1181)) +- Upgrade to Java 11 Jenkins master and agents and increase logging to know why they sometimes die ([#1185](https://github.com/opendevstack/ods-core/pull/1185)) ### Added diff --git a/jenkins/agent-base/Dockerfile.centos7 b/jenkins/agent-base/Dockerfile.centos7 index 9815cc246..cea170d3a 100644 --- a/jenkins/agent-base/Dockerfile.centos7 +++ b/jenkins/agent-base/Dockerfile.centos7 @@ -17,11 +17,10 @@ ARG APP_DNS ARG SNYK_DISTRIBUTION_URL ARG AQUASEC_SCANNERCLI_URL +COPY ensure_java_jre_is_adequate.sh /usr/local/bin/ RUN rm -fv /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/origin-local-release.repo \ + && ensure_java_jre_is_adequate.sh \ && yum -y install openssl \ - && yum -y install java-11-openjdk-devel \ - && yum list installed | grep java \ - && yum -y remove java-1.8* \ && yum -y update \ && yum clean all \ && rm -rf /var/cache/yum/* @@ -115,14 +114,9 @@ RUN . /tmp/set_java_proxy.sh && echo $JAVA_OPTS # It is setting the variable JAVA_TOOL_OPTIONS while it should not. # Besides, we need to know if this variable has not been set. # It is a problem very difficult to detect... +COPY fix_openshift_run_jnlp_client.sh /usr/local/bin/fix_openshift_run_jnlp_client.sh RUN mv /usr/local/bin/run-jnlp-client /usr/local/bin/openshift-run-jnlp-client \ - && sed -i 's|\#\!/bin/bash|\#\!/bin/bash -x|g' /usr/local/bin/openshift-run-jnlp-client \ - && sed -i "s|^\s*JAVA_TOOL_OPTIONS\s*=.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ - /usr/local/bin/openshift-run-jnlp-client \ - && sed -i "s|^\s*export\s*JAVA_TOOL_OPTIONS.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ - /usr/local/bin/openshift-run-jnlp-client \ - && sed -i 's|^\(\s*\)JAVA_GC_OPTS\s*=.*|\1JAVA_GC_OPTS=|g' /usr/local/bin/openshift-run-jnlp-client \ - && grep -B 3 -A 3 -i '\(bash\|JAVA_TOOL_OPTIONS\|JAVA_GC_OPTS\)' /usr/local/bin/openshift-run-jnlp-client + && fix_openshift_run_jnlp_client.sh /usr/local/bin/openshift-run-jnlp-client COPY ods-run-jnlp-client.sh /usr/local/bin/run-jnlp-client diff --git a/jenkins/agent-base/Dockerfile.ubi8 b/jenkins/agent-base/Dockerfile.ubi8 index d9b15b3df..9148e7c68 100644 --- a/jenkins/agent-base/Dockerfile.ubi8 +++ b/jenkins/agent-base/Dockerfile.ubi8 @@ -18,7 +18,9 @@ ARG AQUASEC_SCANNERCLI_URL # Add UBI repositories. COPY yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo +COPY ensure_java_jre_is_adequate.sh /usr/local/bin/ RUN cd /etc/yum.repos.d && rm -f localdev-* ci-rpm-mirrors.repo \ + && ensure_java_jre_is_adequate.sh \ && yum -y install make glibc-langpack-en openssl \ && yum -y update \ && yum clean all \ @@ -115,14 +117,9 @@ COPY set_java_proxy.sh /tmp/set_java_proxy.sh RUN . /tmp/set_java_proxy.sh && echo $JAVA_OPTS # Customize entrypoint. +COPY fix_openshift_run_jnlp_client.sh /usr/local/bin/fix_openshift_run_jnlp_client.sh RUN mv /usr/local/bin/run-jnlp-client /usr/local/bin/openshift-run-jnlp-client \ - && sed -i 's|\#\!/bin/bash|\#\!/bin/bash -x|g' /usr/local/bin/openshift-run-jnlp-client \ - && sed -i "s|^\s*JAVA_TOOL_OPTIONS\s*=.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ - /usr/local/bin/openshift-run-jnlp-client \ - && sed -i "s|^\s*export\s*JAVA_TOOL_OPTIONS.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ - /usr/local/bin/openshift-run-jnlp-client \ - && sed -i 's|^\(\s*\)JAVA_GC_OPTS\s*=.*|\1JAVA_GC_OPTS=|g' /usr/local/bin/openshift-run-jnlp-client \ - && grep -B 3 -A 3 -i '\(bash\|JAVA_TOOL_OPTIONS\|JAVA_GC_OPTS\)' /usr/local/bin/openshift-run-jnlp-client + && fix_openshift_run_jnlp_client.sh /usr/local/bin/openshift-run-jnlp-client COPY ods-run-jnlp-client.sh /usr/local/bin/run-jnlp-client diff --git a/jenkins/agent-base/ensure_java_jre_is_adequate.sh b/jenkins/agent-base/ensure_java_jre_is_adequate.sh new file mode 100755 index 000000000..e47617519 --- /dev/null +++ b/jenkins/agent-base/ensure_java_jre_is_adequate.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -eu -o pipefail + +ME="$(basename $0)" +JAVA_INSTALLED_PKGS_LOGS="/tmp/java_installed_pkgs.log" +JAVA_11_INSTALLED_PKGS_LOGS="/tmp/java_11_installed_pkgs.log" +rm -fv ${JAVA_INSTALLED_PKGS_LOGS} ${JAVA_11_INSTALLED_PKGS_LOGS} + +NEEDS_DEVEL=${1-""} +PKG_NAME_TAIL="headless" +if [ ! -z "${NEEDS_DEVEL}" ] && [ "" != "${NEEDS_DEVEL}" ]; then + NEEDS_DEVEL="true" + PKG_NAME_TAIL="devel" +else + NEEDS_DEVEL="false" + PKG_NAME_TAIL="headless" +fi + +echo "${ME}: Needs development packages? ${NEEDS_DEVEL}" +echo " " +echo "${ME}: Listing versions of java installed: " +yum list installed | grep -i "\(java\|jre\)" | tee -a ${JAVA_INSTALLED_PKGS_LOGS} +touch ${JAVA_11_INSTALLED_PKGS_LOGS} +grep -i "java-11" ${JAVA_INSTALLED_PKGS_LOGS} > ${JAVA_11_INSTALLED_PKGS_LOGS} || echo "No java 11 packages found." + +NEEDS_INSTALLATION="true" +if [ -f ${JAVA_11_INSTALLED_PKGS_LOGS} ]; then + if grep -qi "${PKG_NAME_TAIL}" ${JAVA_11_INSTALLED_PKGS_LOGS} ; then + NEEDS_INSTALLATION="false" + fi +fi + +# We need devel package in masters to have jar binary. +if [ "true" == "${NEEDS_INSTALLATION}" ]; then + echo "${ME}:Java-11 is *not* installed. Installing..." + if [ "true" == "${NEEDS_DEVEL}" ]; then + yum -y install java-11-openjdk-devel + else + yum -y install java-11-openjdk-headless + fi +else + echo "${ME}: Java-11 is already installed." +fi + +if grep -qi "java-1.8" ${JAVA_INSTALLED_PKGS_LOGS} ; then + echo "${ME}: Java-8 is installed. Removing..." + yum -y remove java-1.8* +else + echo "${ME}: Java-8 is not installed. Correct." +fi + +rm -fv ${JAVA_INSTALLED_PKGS_LOGS} ${JAVA_11_INSTALLED_PKGS_LOGS} + +echo " " +echo "${ME}: Checking java tool versions: " +if [ "true" == "${NEEDS_DEVEL}" ]; then + jar --version +fi + +NO_JAVA_LINK="false" +java -version || NO_JAVA_LINK="true" +if [ "true" == "${NO_JAVA_LINK}" ]; then + JAVA_HOME_FOLDER=$(ls -lah /usr/lib/jvm | grep "java-11-openjdk-11.*\.x86_64" | awk '{print $NF}' | head -1) + JAVA_HOME="/usr/lib/jvm/${JAVA_HOME_FOLDER}" + alternatives --set java ${JAVA_HOME}/bin/java +fi +java -version diff --git a/jenkins/agent-base/fix_openshift_run_jnlp_client.sh b/jenkins/agent-base/fix_openshift_run_jnlp_client.sh new file mode 100755 index 000000000..5e143d143 --- /dev/null +++ b/jenkins/agent-base/fix_openshift_run_jnlp_client.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -eu -o pipefail + +FILEPATH=${1-"/usr/local/bin/openshift-run-jnlp-client"} + +if [ ! -f ${FILEPATH} ]; then + echo " " + echo "ERROR: File does not exist: ${FILEPATH}" + echo " " + exit 1 +fi + +sed -i 's|\#\!/bin/bash|\#\!/bin/bash -x|g' ${FILEPATH} +sed -i "s|^\s*JAVA_TOOL_OPTIONS\s*=.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ + ${FILEPATH} +sed -i "s|^\s*export\s*JAVA_TOOL_OPTIONS.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ + ${FILEPATH} +sed -i 's|^\(\s*\)JAVA_GC_OPTS\s*=.*|\1JAVA_GC_OPTS=|g' ${FILEPATH} +sed -i 's|curl\s*-sS\s*|curl -sSLv |g' ${FILEPATH} + +grep -B 3 -A 3 -i '\(bash\|JAVA_TOOL_OPTIONS\|JAVA_GC_OPTS\|curl\)' ${FILEPATH} + + diff --git a/jenkins/master/Dockerfile.centos7 b/jenkins/master/Dockerfile.centos7 index 38cfd048d..f2866928b 100644 --- a/jenkins/master/Dockerfile.centos7 +++ b/jenkins/master/Dockerfile.centos7 @@ -14,7 +14,20 @@ ENV TAILOR_VERSION=1.3.4 USER root COPY ./import_certs.sh /usr/local/bin/import_certs.sh -RUN import_certs.sh +COPY ./ensure_java_jre_is_adequate.sh /usr/local/bin/ensure_java_jre_is_adequate.sh +COPY ./fix_openshift_scripts.sh /usr/local/bin/fix_openshift_scripts.sh +COPY ./clean_yum_cache.sh /usr/local/bin/clean_yum_cache.sh +RUN import_certs.sh \ + && rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key \ + && ensure_java_jre_is_adequate.sh master \ + && fix_openshift_scripts.sh \ + && yum -y update \ + && clean_yum_cache.sh + + +# To debug. Warning: too much logs if we enable it. +#RUN sed -i 's|\#\!\s*/bin/bash.*|\#\!/bin/bash -xeu|g' /usr/local/bin/install-plugins.sh \ +# && head -n 10 /usr/local/bin/install-plugins.sh # Copy configuration and plugins. COPY plugins.centos7.txt /opt/openshift/configuration/plugins.txt @@ -31,7 +44,7 @@ RUN chown :0 /etc/pki/java/cacerts && chmod ugo+w /etc/pki/java/cacerts # Install Tailor. RUN cd /tmp \ - && curl -LOv https://github.com/opendevstack/tailor/releases/download/v${TAILOR_VERSION}/tailor-linux-amd64 \ + && curl -sSLO https://github.com/opendevstack/tailor/releases/download/v${TAILOR_VERSION}/tailor-linux-amd64 \ && mv tailor-linux-amd64 /usr/local/bin/tailor \ && chmod a+x /usr/local/bin/tailor diff --git a/jenkins/master/Dockerfile.rhel7 b/jenkins/master/Dockerfile.rhel7 index 1037e17e1..f5931f7ed 100644 --- a/jenkins/master/Dockerfile.rhel7 +++ b/jenkins/master/Dockerfile.rhel7 @@ -14,7 +14,14 @@ ENV TAILOR_VERSION=1.3.4 USER root COPY ./import_certs.sh /usr/local/bin/import_certs.sh -RUN import_certs.sh +COPY ./ensure_java_jre_is_adequate.sh /usr/local/bin/ensure_java_jre_is_adequate.sh +COPY ./fix_openshift_scripts.sh /usr/local/bin/fix_openshift_scripts.sh +COPY ./clean_yum_cache.sh /usr/local/bin/clean_yum_cache.sh +RUN import_certs.sh \ + && rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key \ + && ensure_java_jre_is_adequate.sh master \ + && fix_openshift_scripts.sh \ + && clean_yum_cache.sh # Copy configuration and plugins. COPY plugins.rhel7.txt /opt/openshift/configuration/plugins.txt diff --git a/jenkins/master/Dockerfile.ubi8 b/jenkins/master/Dockerfile.ubi8 index 6e1642577..8aab71aa4 100644 --- a/jenkins/master/Dockerfile.ubi8 +++ b/jenkins/master/Dockerfile.ubi8 @@ -14,7 +14,17 @@ ENV TAILOR_VERSION=1.3.4 USER root COPY ./import_certs.sh /usr/local/bin/import_certs.sh -RUN import_certs.sh +COPY ./ensure_java_jre_is_adequate.sh /usr/local/bin/ensure_java_jre_is_adequate.sh +COPY ./fix_openshift_scripts.sh /usr/local/bin/fix_openshift_scripts.sh +COPY ./clean_yum_cache.sh /usr/local/bin/clean_yum_cache.sh +RUN import_certs.sh \ + && rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key \ + && sed -i 's|enabled\s*=\s*1|enabled=0|g' /etc/yum.repos.d/ci-rpm-mirrors.repo \ + && sed -i 's|enabled\s*=\s*1|enabled=0|g' /etc/yum.repos.d/localdev-* \ + && sed -i 's|enabled\s*=\s*1|enabled=0|g' /etc/yum.repos.d/epel.repo \ + && ensure_java_jre_is_adequate.sh master \ + && fix_openshift_scripts.sh \ + && clean_yum_cache.sh # Copy configuration and plugins. COPY plugins.ubi8.txt /opt/openshift/configuration/plugins.txt diff --git a/jenkins/master/clean_yum_cache.sh b/jenkins/master/clean_yum_cache.sh new file mode 100755 index 000000000..a4ec6657e --- /dev/null +++ b/jenkins/master/clean_yum_cache.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -eu -o pipefail + +ME="$(basename $0)" + +yum clean all || true +rm -rf /var/cache/yum/* || true diff --git a/jenkins/master/ensure_java_jre_is_adequate.sh b/jenkins/master/ensure_java_jre_is_adequate.sh new file mode 100755 index 000000000..e47617519 --- /dev/null +++ b/jenkins/master/ensure_java_jre_is_adequate.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -eu -o pipefail + +ME="$(basename $0)" +JAVA_INSTALLED_PKGS_LOGS="/tmp/java_installed_pkgs.log" +JAVA_11_INSTALLED_PKGS_LOGS="/tmp/java_11_installed_pkgs.log" +rm -fv ${JAVA_INSTALLED_PKGS_LOGS} ${JAVA_11_INSTALLED_PKGS_LOGS} + +NEEDS_DEVEL=${1-""} +PKG_NAME_TAIL="headless" +if [ ! -z "${NEEDS_DEVEL}" ] && [ "" != "${NEEDS_DEVEL}" ]; then + NEEDS_DEVEL="true" + PKG_NAME_TAIL="devel" +else + NEEDS_DEVEL="false" + PKG_NAME_TAIL="headless" +fi + +echo "${ME}: Needs development packages? ${NEEDS_DEVEL}" +echo " " +echo "${ME}: Listing versions of java installed: " +yum list installed | grep -i "\(java\|jre\)" | tee -a ${JAVA_INSTALLED_PKGS_LOGS} +touch ${JAVA_11_INSTALLED_PKGS_LOGS} +grep -i "java-11" ${JAVA_INSTALLED_PKGS_LOGS} > ${JAVA_11_INSTALLED_PKGS_LOGS} || echo "No java 11 packages found." + +NEEDS_INSTALLATION="true" +if [ -f ${JAVA_11_INSTALLED_PKGS_LOGS} ]; then + if grep -qi "${PKG_NAME_TAIL}" ${JAVA_11_INSTALLED_PKGS_LOGS} ; then + NEEDS_INSTALLATION="false" + fi +fi + +# We need devel package in masters to have jar binary. +if [ "true" == "${NEEDS_INSTALLATION}" ]; then + echo "${ME}:Java-11 is *not* installed. Installing..." + if [ "true" == "${NEEDS_DEVEL}" ]; then + yum -y install java-11-openjdk-devel + else + yum -y install java-11-openjdk-headless + fi +else + echo "${ME}: Java-11 is already installed." +fi + +if grep -qi "java-1.8" ${JAVA_INSTALLED_PKGS_LOGS} ; then + echo "${ME}: Java-8 is installed. Removing..." + yum -y remove java-1.8* +else + echo "${ME}: Java-8 is not installed. Correct." +fi + +rm -fv ${JAVA_INSTALLED_PKGS_LOGS} ${JAVA_11_INSTALLED_PKGS_LOGS} + +echo " " +echo "${ME}: Checking java tool versions: " +if [ "true" == "${NEEDS_DEVEL}" ]; then + jar --version +fi + +NO_JAVA_LINK="false" +java -version || NO_JAVA_LINK="true" +if [ "true" == "${NO_JAVA_LINK}" ]; then + JAVA_HOME_FOLDER=$(ls -lah /usr/lib/jvm | grep "java-11-openjdk-11.*\.x86_64" | awk '{print $NF}' | head -1) + JAVA_HOME="/usr/lib/jvm/${JAVA_HOME_FOLDER}" + alternatives --set java ${JAVA_HOME}/bin/java +fi +java -version diff --git a/jenkins/master/fix_openshift_scripts.sh b/jenkins/master/fix_openshift_scripts.sh new file mode 100755 index 000000000..41d040d44 --- /dev/null +++ b/jenkins/master/fix_openshift_scripts.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -eu -o pipefail + +ME="$(basename $0)" +echo "${ME}: INFO: Fixing openshift scripts..." + +FILE_TO_MODIFY=${1-"/usr/libexec/s2i/run"} + +if [ -f ${FILE_TO_MODIFY} ]; then + sed -i 's|\#\!/bin/bash|\#\!/bin/bash -x|g' ${FILE_TO_MODIFY} + sed -i "s|^\s*JAVA_TOOL_OPTIONS\s*=.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ + ${FILE_TO_MODIFY} + sed -i "s|^\s*export\s*JAVA_TOOL_OPTIONS.*| echo 'WARNING: JAVA_TOOL_OPTIONS env variable is UNSET.'|g" \ + ${FILE_TO_MODIFY} + sed -i 's|^\(\s*\)JAVA_GC_OPTS\s*=.*|\1JAVA_GC_OPTS=|g' ${FILE_TO_MODIFY} + grep -B 3 -A 3 -i '\(bash\|JAVA_TOOL_OPTIONS\|JAVA_GC_OPTS\)' ${FILE_TO_MODIFY} +else + echo " " + echo "${ME}: WARNING: Could not modify file because it does not exist: ${FILE_TO_MODIFY} " + echo " " + echo " " +fi + +echo "${ME}: INFO: Fixed openshift scripts." + diff --git a/jenkins/master/install_jenkins_lts.sh b/jenkins/master/install_jenkins_lts.sh new file mode 100755 index 000000000..659c53fdd --- /dev/null +++ b/jenkins/master/install_jenkins_lts.sh @@ -0,0 +1,45 @@ +#!/bin/bash +set -eu -o pipefail + +ME="$(basename $0)" +echo "${ME}: Upgrading Jenkins to latest LTS version available..." + +# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo +# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key +# sudo yum upgrade +# Add required dependencies for the jenkins package +# sudo yum install java-11-openjdk +# sudo yum install jenkins +# sudo systemctl daemon-reload + +DEFAULT_TARGET="/usr/lib/jenkins/jenkins.war" +TARGET="${DEFAULT_TARGET}" + +curl -sSLO https://get.jenkins.io/war-stable/latest/jenkins.war + +if [ ! -f "${TARGET}" ]; then + echo "${ME}: File does not exist: ${TARGET}" + TARGET="$(find /usr/ -name jenkins.war)" + echo "${ME}: New target: ${TARGET}" +fi + +if [ -f "${TARGET}" ]; then + echo "${ME}: Upgrading Jenkins to latest LTS version... " + rm -fv ${TARGET} + mv -vf jenkins.war ${TARGET} + ls -lah ${TARGET} +else + echo "${ME}: ERROR: Cannot upgrade Jenkins version." + exit 1 +fi + +if [ ! -f "${DEFAULT_TARGET}" ]; then + DEFAULT_TARGET_FOLDER="$(dirname ${DEFAULT_TARGET})" + if [ ! -d ${DEFAULT_TARGET_FOLDER} ]; then + mkdir -pv ${DEFAULT_TARGET_FOLDER} + fi + cd ${DEFAULT_TARGET_FOLDER} && ln -sv ${TARGET} . +fi +ls -la ${DEFAULT_TARGET} ${TARGET} +echo "${ME}: INFO: Jenkins was upgraded to latest LTS version." + diff --git a/jenkins/master/ods-run.sh b/jenkins/master/ods-run.sh index f2e373348..0697d4573 100755 --- a/jenkins/master/ods-run.sh +++ b/jenkins/master/ods-run.sh @@ -81,18 +81,36 @@ if [ -e "${JENKINS_HOME}/plugins" ]; then echo "Copy audit-trail plugin configuration ..." cp -n /opt/openshift/configuration/audit-trail.xml ${JENKINS_HOME}/audit-trail.xml + echo " " + echo "Plugins version already installed in Jenkins: " + ls -la "${JENKINS_HOME}/plugins/" + + echo " " echo "Enforcing plugin versions defined in the image ..." if [ "$(ls /opt/openshift/plugins/* 2>/dev/null)" ]; then echo "Copying $(ls /opt/openshift/plugins/* | wc -l) files to ${JENKINS_HOME} ..." for FILENAME in /opt/openshift/plugins/* ; do # also need to nuke the metadir; it will get properly populated on jenkins startup basefilename=`basename $FILENAME .jpi` - rm -rf "${JENKINS_HOME}/plugins/${basefilename}" - cp --remove-destination $FILENAME ${JENKINS_HOME}/plugins + rm -rfv "${JENKINS_HOME}/plugins/${basefilename}" + cp -v --remove-destination $FILENAME ${JENKINS_HOME}/plugins done rm -rf /opt/openshift/plugins fi fi -echo "Booting Jenkins ..." -/usr/libexec/s2i/openshift-run +echo " " +echo "Booting Jenkins ( /usr/libexec/s2i/openshift-run ) ..." +echo " " +JENKINS_ERROR="false" +/usr/libexec/s2i/openshift-run || JENKINS_ERROR="true" + +if [ "false" != "${JENKINS_ERROR}" ]; then + echo " " + echo "Jenkins exit code was not 0. Something went wrong." + echo "Waiting 10 secs, so the pod does not die before showing in its log all jenkins logs." + echo " " + sleep 10 + exit 1 +fi + diff --git a/ods-devenv/scripts/deploy.sh b/ods-devenv/scripts/deploy.sh index 0b4a14f92..a82f3dc86 100755 --- a/ods-devenv/scripts/deploy.sh +++ b/ods-devenv/scripts/deploy.sh @@ -1603,11 +1603,11 @@ function wait_until_http_svc_is_up_advanced() { if [ -f ${CURL_SVC_OUTPUT_FILE} ] || [ -f ${CURL_SVC_HEADERS_FILE} ]; then echo "Removing files: rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} " - rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} || true + rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE} || true - if [ -f ${CURL_SVC_OUTPUT_FILE} ] || [ -f ${CURL_SVC_HEADERS_FILE} ]; then - echo "Removing files (with sudo): rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} " - sudo rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} || true + if [ -f ${CURL_SVC_OUTPUT_FILE} ] || [ -f ${CURL_SVC_HEADERS_FILE} ] || [ -f ${CURL_LOGS_CHECK_SVC_FILE} ]; then + echo "Removing files (with sudo): rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE}" + sudo rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE} || true fi fi @@ -1625,8 +1625,8 @@ function wait_until_http_svc_is_up_advanced() { # Remove files from previous execution. rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE} || true - if [ -f ${CURL_SVC_OUTPUT_FILE} ] || [ -f ${CURL_SVC_HEADERS_FILE} ]; then - echo "[STATUS CHECK] WARNING: Could NOT remove files ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} " + if [ -f ${CURL_SVC_OUTPUT_FILE} ] || [ -f ${CURL_SVC_HEADERS_FILE} ] || [ -f ${CURL_LOGS_CHECK_SVC_FILE} ]; then + echo "[STATUS CHECK] WARNING: Could NOT remove files ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE}" fi local CURL_RETURN_VAL=0 @@ -1648,7 +1648,7 @@ function wait_until_http_svc_is_up_advanced() { done # Removes tmp files used for checking. - rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} || true + rm -fv ${CURL_SVC_OUTPUT_FILE} ${CURL_SVC_HEADERS_FILE} ${CURL_LOGS_CHECK_SVC_FILE} || true echo "Service ${SVC_NAME} is up at ${SVC_HTTP_URL}" echo " "