diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c9775278d732dd8574a46f92b739d7ccba125bf..21c49ad8d77054d0449326345c4643974e2cf0d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,7 +76,9 @@ stages: cache: {} image: ${CODE_REGISTRY}/ghsc/hazdev/cloud-formation/hazdev-build-runner:latest dependencies: + retry: 2 before_script: + - docker stack rm nshmp-netcdf - *static-data - | for data in ${STATIC_DATA}; do diff --git a/Dockerfile b/Dockerfile index 543b66f363de91094bed3bbd0549ff0fe2899e4b..c91cb67cd77299c22cac329cc25583697b50ceb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,14 +49,13 @@ ARG netcdf_file="src/main/resources/default.nc" # The NSHM to use ENV NSHM "CONUS_2018" -ENV CONTEXT_PATH "" +ENV CONTEXT_PATH "/" ARG jar_file ARG project ARG workdir ENV PROJECT ${project} ENV NETCDF_FILE ${netcdf_file} -ENV MN_CONTEXT_PATH "-Dmicronaut.server.context-path=${CONTEXT_PATH}" WORKDIR ${workdir} @@ -67,6 +66,6 @@ RUN yum install -y java-11-openjdk-headless EXPOSE 8080 ENTRYPOINT /usr/bin/java -jar ${PROJECT}.jar \ - ${MN_CONTEXT_PATH} \ + "-Dmicronaut.server.context-path=${CONTEXT_PATH}" \ -nshm=${NSHM} \ -netcdf=${NETCDF_FILE} diff --git a/build.gradle b/build.gradle index c83b06c71181a27b883881203773722c66161474..21bccd4e49d40b33e478fddeab2ec2555fc35ed2 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ dependencies { implementation "edu.ucar:netcdf4:${netcdfVersion}" implementation "org.slf4j:slf4j-jdk14:${slfVersion}" - // micronaut + // Micronaut annotationProcessor platform("io.micronaut:micronaut-bom:${mnVersion}") annotationProcessor "io.micronaut:micronaut-inject-java" annotationProcessor "io.micronaut:micronaut-validation" @@ -46,7 +46,6 @@ dependencies { implementation "io.micronaut:micronaut-runtime" implementation "io.micronaut:micronaut-http-server-netty" implementation "com.fasterxml.jackson.module:jackson-module-parameter-names:${jacksonVersion}" - runtimeOnly "io.micronaut:micronaut-runtime-osx" runtimeOnly "ch.qos.logback:logback-classic:${logbackVersion}" // Swagger diff --git a/scripts/custom.config.sh b/scripts/custom.config.sh index d5daf278793ea5b6bc31fabb820498169933eb8a..e90375e1136b26a22343a4bfabb4481cc290c043 100644 --- a/scripts/custom.config.sh +++ b/scripts/custom.config.sh @@ -1,3 +1,3 @@ export SERVICE_MAP=( - "/nshmp-ws/static/conus-2018":"conus-2018a" + "/nshmp/ws/static/conus-2018":"conus-2018a" ); diff --git a/scripts/nshmp-netcdf.yml b/scripts/nshmp-netcdf.yml index 1f08dc6fa64fbb9072fb00ea9591a6639a7eda59..55ea8036828a34a86f2654670c1f2f858b81a257 100644 --- a/scripts/nshmp-netcdf.yml +++ b/scripts/nshmp-netcdf.yml @@ -22,4 +22,4 @@ services: image: ${REGISTRY}/${CI_PROJECT_NAME}:${DATA_CONUS_2018A} environment: NSHM: CONUS_2018 - CONTEXT_PATH: /nshmp-ws/static/conus-2018 + CONTEXT_PATH: /nshmp/ws/static/conus-2018 diff --git a/src/main/resources/swagger/index.html b/src/main/resources/swagger/index.html index 44630b91f99a6f74e84dce414c1caa9f7dfdee8c..a1c3c76a4d93b88a522dbf5060ca00b4bebbf947 100644 --- a/src/main/resources/swagger/index.html +++ b/src/main/resources/swagger/index.html @@ -11,13 +11,16 @@ <script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script> <script> + let pathname = window.location.pathname; + pathname = pathname == "/" ? "" : pathname; + SwaggerUIBundle({ - url: "./swagger/netcdf-services.yml", + url: `${pathname}/swagger/netcdf-services.yml`, dom_id: '#swagger-ui', presets: [ SwaggerUIBundle.presets.apis ] - }) + }); </script> </body> </html>