Commit 32ca5c64 authored by Vesa Vertainen's avatar Vesa Vertainen

Fixed build.sh to stop at missing htpasswd

parent 78d680fa
Pipeline #84288092 passed with stage
in 14 minutes and 23 seconds
......@@ -376,15 +376,20 @@ EOF
## Create certs and credentials for private registry
echo -e "$CHECK Added certificate for Docker private registry" ${BUILD_PATH}/certs/${COMMON_NAME_REGISTRY}.crt /etc/docker/certs.d/${EXTERNAL_URL_REGISTRY}:5000/ca.crt
if [ ! -d /etc/docker/certs.d/${EXTERNAL_URL_REGISTRY}:5000 ]; then mkdir -p /etc/docker/certs.d/${EXTERNAL_URL_REGISTRY}:5000; fi
cp ${BUILD_PATH}/certs/${COMMON_NAME_REGISTRY}.crt /etc/docker/certs.d/${EXTERNAL_URL_REGISTRY}:5000/ca.crt
echo -e "$CHECK Added certificate for Docker private registry" "${BUILD_PATH}"/certs/"${COMMON_NAME_REGISTRY}".crt /etc/docker/certs.d/"${EXTERNAL_URL_REGISTRY}":5000/ca.crt
if [ ! -d /etc/docker/certs.d/"${EXTERNAL_URL_REGISTRY}":5000 ]; then mkdir -p /etc/docker/certs.d/"${EXTERNAL_URL_REGISTRY}":5000; fi
cp "${BUILD_PATH}"/certs/"${COMMON_NAME_REGISTRY}".crt /etc/docker/certs.d/"${EXTERNAL_URL_REGISTRY}":5000/ca.crt
if [ ! -d /opt/cincan/auth ]; then mkdir /opt/cincan/auth; fi
htpasswd -Bbc /opt/cincan/auth/htpasswd ${USER_NAME} ${PASSWORD}
if htpasswd -Bbc /opt/cincan/auth/htpasswd "${USER_NAME}" "${PASSWORD}"; then
echo -e "$CHECK passwd file created for private registry"
else
echo -e "$ERROR Htpasswd failed, is it installed? (Install: apache2-utils for Debian based or httpd-tools for RedHat derived OS)"
exit 1
fi
# Create README and inform user
## Create README and inform user
cat > "${BUILD_PATH}/build/README" << EOL
Now you should be able to build the pilot environment using following commands on host system:
......
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