Skip to content
Snippets Groups Projects

WS-702 Added yaml and sh scripts to build go modules via CI

Merged Nathan Bockisch requested to merge WS-702 into main
+ 41
35
stages:
- build-base
- push-base
- cache-build
- build
- unit-test
- test-coverage
- push
- deploy-coverage-page
# - build-base
# - push-base
# - cache-build
# - build
# - unit-test
# - test-coverage
# - push
# - deploy-coverage-page
- generate-yaml
- trigger
- deploy
- e2e-test
- .post
# - deploy
# - e2e-test
# - .post
variables:
# Gitlab optimization https://docs.gitlab.com/ee/ci/large_repositories/
@@ -44,7 +44,7 @@ include:
- '/ci/unit-test.template.yml'
# Build Base Image
build base image:
.build base image:
interruptible: true
stage: build-base
script:
@@ -57,7 +57,7 @@ build base image:
- docker.properties
# Push Base Image Stage
push base image:
.push base image:
interruptible: true
stage: push-base
script:
@@ -70,7 +70,7 @@ push base image:
- docker.properties
# Cache
build cache:
.build cache:
interruptible: true
stage: cache-build
variables:
@@ -81,7 +81,7 @@ build cache:
- docker build -t cache:${CI_COMMIT_SHORT_SHA} -f Dockerfile.cache .
# Build Stages
build workflow:
.build workflow:
interruptible: true
stage: build
variables:
@@ -89,7 +89,7 @@ build workflow:
PATH_PREFIX: "services/"
extends: .build
build capability:
.build capability:
interruptible: true
stage: build
variables:
@@ -97,7 +97,7 @@ build capability:
PATH_PREFIX: "services/"
extends: .build
build notification:
.build notification:
interruptible: true
stage: build
variables:
@@ -105,7 +105,7 @@ build notification:
PATH_PREFIX: "services/"
extends: .build
build web:
.build web:
interruptible: true
stage: build
variables:
@@ -116,7 +116,7 @@ build web:
## Test Stages ##
# Unit Tests
unit test workflow:
.unit test workflow:
interruptible: true
stage: unit-test
variables:
@@ -125,7 +125,7 @@ unit test workflow:
needs:
- build workflow
unit test capability:
.unit test capability:
interruptible: true
stage: unit-test
variables:
@@ -134,7 +134,7 @@ unit test capability:
needs:
- build capability
unit test notification:
.unit test notification:
interruptible: true
stage: unit-test
variables:
@@ -145,7 +145,7 @@ unit test notification:
# Generate Coverage reports
unit test coverage:
.unit test coverage:
interruptible: true
stage: test-coverage
image: python:3.8-slim
@@ -171,7 +171,7 @@ unit test coverage:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
# E2E Tests
e2e:
.e2e:
interruptible: true
stage: e2e-test
image: docker/compose:1.27.4
@@ -207,25 +207,25 @@ e2e:
retry: 2
# Push Stages
push workflow:
.push workflow:
stage: push
variables:
SERVICE_NAME: "workflow"
extends: .push
push capability:
.push capability:
stage: push
variables:
SERVICE_NAME: "capability"
extends: .push
push notification:
.push notification:
stage: push
variables:
SERVICE_NAME: "notification"
extends: .push
push web:
.push web:
stage: push
variables:
SERVICE_NAME: "web"
@@ -235,28 +235,28 @@ push web:
# - unit test dev ui
# Cleanup
clean build workflow:
.clean build workflow:
stage: .post
variables:
SERVICE_NAME: "workflow"
extends: .cleanup
allow_failure: true
clean build capability:
.clean build capability:
stage: .post
variables:
SERVICE_NAME: "capability"
extends: .cleanup
allow_failure: true
clean build notification:
.clean build notification:
stage: .post
variables:
SERVICE_NAME: "notification"
extends: .cleanup
allow_failure: true
clean build web:
.clean build web:
stage: .post
variables:
SERVICE_NAME: "web"
@@ -264,7 +264,7 @@ clean build web:
allow_failure: true
# Deploy Stages
pages:
.pages:
interruptible: true
stage: deploy-coverage-page
image: python:3.8-slim
@@ -339,9 +339,12 @@ go generate yaml:
script:
- DEPLOY_ENV=${DEPLOY_ENV} ./ci/bin/generate-go-yaml.py
rules:
- if: $CI_MERGE_REQUEST_ID
changes:
- apps/cli/executables/go/**/*
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
- apps/cli/executables/pexable/**/*
- apps/cli/executables/go/**/*
- if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+/'
variables:
# override DEPLOY_ENV
@@ -351,7 +354,7 @@ go generate yaml:
DEPLOY_ENV: "prod"
artifacts:
paths:
- generated-pex-build-pipeline.yml
- generated-go-build-pipeline.yml
# Trigger child pipeline based on generated go builder yaml
go child pipeline:
@@ -362,6 +365,9 @@ go child pipeline:
job: go generate yaml
strategy: depend
rules:
- if: $CI_MERGE_REQUEST_ID
changes:
- apps/cli/executables/go/**/*
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
- apps/cli/executables/go/**/*
@@ -374,7 +380,7 @@ go child pipeline:
DEPLOY_ENV: "prod"
# Development
deploy:
.deploy:
stage: deploy
script:
# Docker doesn't allow variable interpolation when declaring Docker Secret names
Loading