diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 971caf9423534d86ef99c6bcd841ebe5bd09ced3..6b6d2c58216719d336a003eb83ecc35a91b9fa99 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,10 +13,17 @@ variables: DATA_CONUS_2018A: conus-2018a stages: + - assemble - test - publish - deploy +cache: + key: one-key-to-rule-them-all + paths: + - build + - .gradle + #### # Templates: # - install-aws: Install aws in a Alpine environment @@ -61,7 +68,6 @@ 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 @@ -87,6 +93,9 @@ stages: variables: APP_NAME: nshmp-netcdf STACK_NAME: nshmp-netcdf + retry: + max: 2 + when: 'always' .staging: only: @@ -102,41 +111,23 @@ stages: - staging02 #### -# Build jar file. -# Globals: -# (string) CI_PROJECT_NAME - The name of the project +# Stage: assemble #### -Build Project: - extends: - - .gradle - script: - - ./gradlew --no-daemon assemble -#### -# Run Spotless check. -#### -Spotless Check: +Build Project: extends: - .gradle + stage: assemble script: - - ./gradlew --no-daemon spotlessCheck + - ./gradlew --build-cache --no-daemon assemble + retry: + max: 2 + when: 'always' #### -# Run Spotbugs main. +# Stage: test #### -Spotbugs Main: - extends: - - .gradle - script: - - ./gradlew --no-daemon spotbugsMain -#### -# Run tests. -# Globals: -# (string) JACOCO_HTML_DIR - Directory of Jacoco html reports -# (string) JUNIT_FILES - Path to all Junit html files -# (string) CI_PROJECT_NAME - The name of the project -#### Unit Tests: stage: test image: gradle:jdk11 @@ -154,12 +145,10 @@ Unit Tests: - ${REPORTS_DIR} reports: junit: ${JUNIT_FILES} + retry: + max: 2 + when: 'always' -#### -# Build Docker image. -# Globals: -# IMAGE_NAME - Docker image name -#### Build Image: stage: test image: docker:stable-git @@ -176,12 +165,10 @@ Build Image: --build-arg git_username="${GIT_NSHMP_USERNAME}" \ --build-arg git_password="${GIT_NSHMP_PASSWORD}" \ -t local/${IMAGE_NAME} . + retry: + max: 2 + when: 'always' -#### -# Build and publish Docker images with data from AWS S3. -# Globals: -# IMAGE_NAME - Docker image name -#### Build/Publish Data Images: stage: publish image: docker:stable-git @@ -212,19 +199,20 @@ Build/Publish Data Images: docker image rm ${INTERNAL_IMAGE_NAME}; done - rm -rf /root/.docker/config.json + retry: + max: 2 + when: 'always' #### -# Deploy to stage01 +# Stage: deploy #### + Staging 01: extends: - .deploy - .staging - .staging01 -#### -# Deploy to stage02 -#### Staging 02: extends: - .deploy diff --git a/Dockerfile b/Dockerfile index 8e15d195b7bb7738bd701b5f3cc1f9a0600a64d9..ed142d36a6d66ea7ef0ece0a48ddd14d11001552 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ ENV GIT_NSHMP_PASSWORD ${git_password} WORKDIR ${workdir} -RUN yum install -y java-11-openjdk which git +RUN yum install -y glibc-langpack-en java-11-openjdk which git COPY build.gradle . COPY .git .git