This commit is contained in:
2024-05-05 08:37:35 -05:00
parent f1d097a01a
commit 70823bb3ed
10 changed files with 37 additions and 20 deletions

View File

@@ -3,8 +3,8 @@ stages:
- deploy
variables:
GO_VERSION: "1.20"
GOLANGCI_LINT_VERISON: "v1.55.2"
GO_VERSION: "1.22"
GOLANGCI_LINT_VERISON: "v1.58.0"
gitlab_generic_package:
stage: deploy
@@ -19,10 +19,10 @@ gitlab_generic_package:
rules:
- if: '$PIPELINE =~ /gitlab/'
build_go_api:
build_go:
stage: deploy
needs:
- job: compliance
#needs:
# - job: compliance
trigger:
include:
- project: 'developerdurp/yml'

View File

@@ -1,6 +1,7 @@
stages:
- build
- package
- validate
- publish
include:
@@ -26,8 +27,21 @@ gobuild:
extends: .golang-build
stage: build
docker-build:
extends: .docker_build
stage: build
needs:
- job: gobuild
artifacts: true
- job: version
optional: true
artifacts: true
rules:
- exists:
- "Dockerfile"
docker:
extends: .docker-build-container
extends: .docker_push_gitlab
stage: publish
needs:
- job: gobuild
@@ -36,19 +50,8 @@ docker:
artifacts: true
rules:
- if: $CI_COMMIT_REF_NAME == 'main'
- if: $CI_COMMIT_BRANCH =~ '/^release/'
publish:
extends: .octo_release
stage: publish
needs:
- job: version
artifacts: true
rules:
exists:
- "Dockerfile"
- if: $CI_COMMIT_BRANCH =~ '/^release/'
exists:
- $OCTO_PROJECT_NAME
- if: $CI_COMMIT_BRANCH =~ 'main'
exists:
- $OCTO_PROJECT_NAME
- when: never
- "Dockerfile"

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
#%%MULTILINE_YAML_START
#check for Version variable
if [ -z "${VERSION}" ]; then
# If not, assign a default value
VERSION=$CI_COMMIT_SHORT_SHA
fi

View File

@@ -22,7 +22,12 @@
- name: docker:dind
entrypoint: ["dockerd-entrypoint.sh", "--tls=false"]
script:
- ./scripts/checkvariable/version.sh
- ./scripts/docker/build.sh
artifacts:
expire_in: 1 hour
paths:
- $CI_PROJECT_DIR/packages
.docker_push_gitlab:
image: registry.internal.durp.info/docker:20.10.17