From 235f59e4924809a1d15a878253070b8c318ad693 Mon Sep 17 00:00:00 2001 From: Luca Pasquali Date: Mon, 1 Feb 2021 18:40:34 +0100 Subject: [PATCH] Adding some fixes for PR\ - fix help function - create ./resources/geoserver-plugins if needed (it was already present but using wrong var) - removed marlin --- custom_build.sh | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/custom_build.sh b/custom_build.sh index 5aa54f9..3812fb4 100755 --- a/custom_build.sh +++ b/custom_build.sh @@ -10,17 +10,15 @@ readonly ALL_PARAMETERS=$* readonly BASE_BUILD_URL="https://build.geoserver.org/geoserver" readonly BASE_BUILD_URL_STABLE="https://netcologne.dl.sourceforge.net/project/geoserver/GeoServer" readonly EXTRA_FONTS_URL="https://www.dropbox.com/s/hs5743lwf1rktws/fonts.tar.gz?dl=1" -readonly MARLIN_VERSION=0.9.2 readonly ARTIFACT_DIRECTORY=./resources readonly GEOSERVER_ARTIFACT_DIRECTORY=${ARTIFACT_DIRECTORY}/geoserver/ readonly DATADIR_ARTIFACT_DIRECTORY=${ARTIFACT_DIRECTORY}/geoserver-datadir/ readonly PLUGIN_ARTIFACT_DIRECTORY=${ARTIFACT_DIRECTORY}/geoserver-plugins readonly FONTS_ARTIFACT_DIRECTORY=${ARTIFACT_DIRECTORY}/fonts/ -readonly MARLIN_ARTIFACT_DIRECTORY=${ARTIFACT_DIRECTORY}/marlin/ function help(){ - if [ "$#" -ne 6 ] ; then - echo "Usage: $0 [docker image tag] [geoserver version] [geoserver master version] [datadir| nodatadir] [pull|no pull];" + if [ "$#" -ne 5 ] ; then + echo "Usage: $0 [docker image tag] [geoserver version] [geoserver master version] [datadir| nodatadir] [pull|no_pull];" echo ""; echo "[docker image tag] : the tag to be used for the docker iamge "; echo "[geoserver version] : the release version of geoserver to be used; you can set it to master if you want the last release"; @@ -81,8 +79,8 @@ function download_plugin() { esac - if [ ! -e "${PLUGIN_ARTIFACT_URL}" ]; then - mkdir -p "${PLUGIN_ARTIFACT_URL}" + if [ ! -e "${PLUGIN_ARTIFACT_DIRECTORY}" ]; then + mkdir -p "${PLUGIN_ARTIFACT_DIRECTORY}" fi @@ -97,23 +95,6 @@ function download_fonts() { download_from_url_to_a_filepath "${EXTRA_FONTS_URL}" "${FONTS_ARTIFACT_DIRECTORY}/fonts.tar.gz" } -function download_marlin() { - IFS='.' read -r -a marlin_v_arr <<< "$MARLIN_VERSION" - unset IFS - - marlin_major=${marlin_v_arr[0]} - marlin_minor=${marlin_v_arr[1]} - marlin_patch=${marlin_v_arr[2]} - - if [ ! -e "${MARLIN_ARTIFACT_DIRECTORY}" ]; then - mkdir -p "${MARLIN_ARTIFACT_DIRECTORY}" - fi - - marlin_url_1="https://github.com/bourgesl/marlin-renderer/releases/download/v${marlin_major}_${marlin_minor}_${marlin_patch}/marlin-${marlin_major}.${marlin_minor}.${marlin_patch}-Unsafe.jar" - marlin_url_2="https://github.com/bourgesl/marlin-renderer/releases/download/v${marlin_major}_${marlin_minor}_${marlin_patch}/marlin-${marlin_major}.${marlin_minor}.${marlin_patch}-Unsafe-sun-java2d.jar" - download_from_url_to_a_filepath "${marlin_url_1}" "${MARLIN_ARTIFACT_DIRECTORY}/marlin-${marlin_major}.${marlin_minor}.${marlin_patch}-Unsafe.jar" - download_from_url_to_a_filepath "${marlin_url_2}" "${MARLIN_ARTIFACT_DIRECTORY}/marlin-${marlin_major}.${marlin_minor}.${marlin_patch}-Unsafe-sun-java2d.jar" -} function download_geoserver() { clean_up_directory ${GEOSERVER_ARTIFACT_DIRECTORY} @@ -151,7 +132,7 @@ function build_with_data_dir() { --build-arg GEOSERVER_WEBAPP_SRC=${GEOSERVER_ARTIFACT_DIRECTORY}/geoserver.war \ --build-arg PLUG_IN_URLS=$PLUGIN_ARTIFACT_DIRECTORY \ --build-arg GEOSERVER_DATA_DIR_SRC=${GEOSERVER_DATA_DIR_DIRECTORY} \ - -t geosolutionsit/geoserver:"${TAG}-${GEOSERVER_VERSION}" \ + -t geoserver/geoserver:"${TAG}-${GEOSERVER_VERSION}" \ . } @@ -167,7 +148,7 @@ function build_without_data_dir() { ${DOCKER_BUILD_COMMAND} --no-cache \ --build-arg GEOSERVER_WEBAPP_SRC=${GEOSERVER_ARTIFACT_DIRECTORY}/geoserver.war \ --build-arg PLUG_IN_URLS=$PLUGIN_ARTIFACT_DIRECTORY\ - -t geosolutionsit/geoserver:"${TAG}-${GEOSERVER_VERSION}" \ + -t geoserver/geoserver:"${TAG}-${GEOSERVER_VERSION}" \ . } @@ -178,9 +159,8 @@ function main { download_plugin ext monitor download_plugin ext control-flow download_plugin community sec-oauth2-geonode - #download_marlin - if [[ ${GEOSERVER_DATA_DIR_RELEASE} = "nodatadir" ]]; then + if [[ ${GEOSERVER_DATA_DIR_RELEASE} = "nodatadir" ]]; then build_without_data_dir "${TAG}" "${PULL}" else clean_up_directory ${DATADIR_ARTIFACT_DIRECTORY}