Skip to content
Snippets Groups Projects
Commit 700901a7 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Add pipelines

parent bd995d23
No related branches found
No related tags found
1 merge request!695Resolves - Legacy: Add CI/CD Pipeline
variables:
CI_DEFAULT_BRANCH: legacy-main
CI_PROJECT_NAME: nshmp-haz-legacy
JACOCO_HTML_DIR: ${REPORTS_DIR}/jacoco/test/html
JUNIT_FILES: build/test-results/test*/TEST-*.xml
PRODUCTION_BRANCH: legacy-production
UPSTREAM_PATH: ghsc/nshmp/nshmp-haz
......@@ -12,6 +14,11 @@ workflow:
stages:
- build
- test
default:
tags:
- nshmp
####
# Environment Templates
......@@ -53,6 +60,17 @@ stages:
variables:
ENVIRONMENT: production
####
# Java Templates
####
##
# General Java setup
##
.java:
image: ${DEVOPS_REGISTRY}usgs/amazoncorretto:8
####
# Docker Templates
####
......@@ -125,7 +143,6 @@ stages:
stage: build
tags:
- build
variables:
####
# Stage: build
......@@ -140,3 +157,29 @@ Build Image:
FROM_IMAGE=${DEVOPS_REGISTRY}usgs/amazoncorretto:8
DOCKERFILE: Dockerfile
IMAGE_TAG: ${ENVIRONMENT}-${CI_COMMIT_SHORT_SHA}
Build Project:
extends:
- .java
script:
- ./gradlew assemble
stage: build
####
# Stage: test
####
Unit Tests:
artifacts:
paths:
- ${JACOCO_HTML_DIR}
reports:
junit: ${JUNIT_FILES}
coverage: '/Total.*?([0-9]{1,3})%/'
extends:
- .java
needs: []
script:
- ./gradlew check
- cat ${JACOCO_HTML_DIR}/index.html
stage: test
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment