Skip to content
Snippets Groups Projects

Landing Page

1 file
+ 19
38
Compare changes
  • Side-by-side
  • Inline
+ 19
38
@@ -4,9 +4,7 @@ variables:
JUNIT_FILES: build/test-results/test/TEST-*.xml
REPORTS_DIR: build/reports
stages:
- build
- trigger
image: ${CI_REGISTRY}/devops/images/usgs/java:11
# Do not run for merge requests
workflow:
@@ -14,6 +12,14 @@ workflow:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
stages:
- build
- trigger
default:
tags:
- nshmp
####
# Environment Templates
####
@@ -63,10 +69,10 @@ workflow:
# 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
@@ -101,14 +107,6 @@ workflow:
- latest_image_name="${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest";
- docker tag "${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${IMAGE_TAG}" "${latest_image_name}";
- docker push "${latest_image_name}";
- if [[
${CI_COMMIT_REF_SLUG} == "${CI_DEFAULT_BRANCH}" ||
${CI_COMMIT_REF_SLUG} == "production" ||
-n "${CI_COMMIT_TAG}"
]]; then
docker tag "${latest_image_name}" "usgs/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest";
docker push "usgs/${CI_PROJECT_NAME}:${ENVIRONMENT}-latest";
fi
- |
printf "
--------
@@ -121,23 +119,10 @@ workflow:
variables:
DOCKERFILE: Dockerfile
DOCKER_BUILD_ARGS: |
BUILD_IMAGE=${DEVOPS_REGISTRY}usgs/centos:latest
FROM_IMAGE=${DEVOPS_REGISTRY}usgs/centos:latest
BUILD_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11
FROM_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11
IMAGE_TAG: ${ENVIRONMENT}-${CI_COMMIT_SHORT_SHA}
####
# Java Templates
####
##
# General Java setup
##
.java:
image: ${DEVOPS_REGISTRY}usgs/amazoncorretto:11
stage: build
tags:
- nshmp
####
# Stage: build
####
@@ -147,23 +132,21 @@ Build Image:
- .docker-build
variables:
DOCKER_BUILD_ARGS: |
BUILD_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
BUILD_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11
CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
CI_PROJECT_URL=${CI_PROJECT_URL}
FROM_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:11
FROM_IMAGE=${CI_REGISTRY}/devops/images/usgs/java:11
UPSTREAM_PATH: ghsc/nshmp/nshmp-ws
Build Project:
extends:
- .java
script:
- ./gradlew assemble
stage: build
Markdown Lint:
extends:
- .java
script:
- ./gradlew markdownlint
stage: build
Unit Tests:
artifacts:
@@ -172,17 +155,15 @@ Unit Tests:
reports:
junit: ${JUNIT_FILES}
coverage: '/Total.*?([0-9]{1,3})%/'
extends:
- .java
script:
- ./gradlew check
- cat ${JACOCO_HTML_DIR}/index.html
stage: build
YAML Lint:
extends:
- .java
script:
- ./gradlew yamllint
stage: build
####
# Stage: trigger
Loading