diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee30d24b0ecbd89910f285cbb9d34ad9e07ae564..72f034fcbb841181e75ce9b623d5188e177e749a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,8 @@ variables: PRODUCTION_BRANCH: legacy-ws-production UPSTREAM_PATH: ghsc/nshmp/nshmp-haz +image: ${CI_REGISTRY}/devops/images/usgs/java:11 + # Do not run for merge requests workflow: rules: @@ -58,16 +60,6 @@ default: variables: ENVIRONMENT: production -#### -# Java Templates -#### - -## -# General Java setup -## -.java: - image: ${DEVOPS_REGISTRY}usgs/amazoncorretto:8 - #### # Docker Templates #### @@ -76,10 +68,10 @@ default: # Docker in Docker ## .dind: - image: ${DEVOPS_REGISTRY}docker:19.03-git + image: ${CI_REGISTRY}/devops/images/docker:20 services: - alias: docker - name: ${DEVOPS_REGISTRY}docker:19.03-dind + name: ${CI_REGISTRY}/devops/images/docker:20-dind variables: DOCKER_DRIVER: overlay2 @@ -118,18 +110,9 @@ default: docker tag "${env_image_name}" "${sha_image_name}"; docker push "${sha_image_name}"; - | - docker_latest_image="usgs/${CI_PROJECT_NAME}:latest"; - docker_env_image="usgs/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest"; - - docker tag "${env_image_name}" "${docker_env_image}"; - docker push "${docker_env_image}"; - if [[ "${ENVIRONMENT}" != "development" ]]; then docker tag "${env_image_name}" "${latest_image_name}"; docker push "${latest_image_name}"; - - docker tag "${env_image_name}" "${docker_latest_image}"; - docker push "${docker_latest_image}"; fi - | printf " @@ -150,14 +133,12 @@ Build Image: - .docker-build variables: DOCKER_BUILD_ARGS: | - BUILD_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:8 - FROM_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:8 + BUILD_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11 + FROM_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11 DOCKERFILE: Dockerfile IMAGE_TAG: ${ENVIRONMENT}-${CI_COMMIT_SHORT_SHA} Build Project: - extends: - - .java before_script: - mkdir -p ${DIR} - mv $(ls -1 | grep -v $(basename $(dirname ${DIR}))) ${DIR}/. @@ -183,7 +164,6 @@ Trigger nshmp-haz-ws Legacy CDK: - *staging-env - *production-env script: - - apk add curl - | if [ "${ENVIRONMENT}" == 'production' ]; then REF="production"; diff --git a/Dockerfile b/Dockerfile index fa5ab6f274c908129b031b88a7dfe55367e44f58..be213074dc60c928cbf8421ce79ed644d3b7f0be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ # OutOfMemoryError. Increase -Xmx to -Xmx16g or -Xmx24g, if available. #### -ARG FROM_IMAGE=usgs/amazoncorretto:8 +ARG FROM_IMAGE=code.usgs.gov:5001/devops/images/usgs/java:11 #### # Build nshmp-haz-ws @@ -43,7 +43,10 @@ ENV TOMCAT_URL=${TOMCAT_SOURCE}/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${ # Install Tomcat WORKDIR ${CATALINA_HOME} -RUN curl -L ${TOMCAT_URL} | tar -xz --strip-components=1 +USER root +RUN yum install -y tar \ + && curl -L ${TOMCAT_URL} | tar -xz --strip-components=1 +USER usgs-user ENV WORKDIR=/app ENV WAR_PATH=${WORKDIR}/build/libs/nshmp-haz-ws.war