Commit 1380446b authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

ci: support custom TBC group as an alternative CI/CD configuration

This change restores the working build for basic forking workflow on gitlab.com.
parent 208a0dda
Loading
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
# Alternative CI/CD configuration file when using TBC in a self-managed GitLab with a custom TBC root group (different from the default "to-be-continuous")
# ℹ️ The CI/CD configuration file can be selected in your project: Settings > CI/CD > General Pipelines > CI/CD Configuration File.
# ⚠️ Requires that the TBC_NAMESPACE variable be set as a server instance variable (recommended), group variable, or project variable.
include:
  # $TBC_NAMESPACE is a group variable; can be globally overridden
  - project: "$TBC_NAMESPACE/golang"
    ref: "4.7"
    file: "templates/gitlab-ci-golang.yml"
  - project: "$TBC_NAMESPACE/docker"
    ref: "6.1"
    file: "templates/gitlab-ci-docker.yml"

variables:
  GO_BUILD_FLAGS: -tags netgo
  GO_IMAGE: "docker.io/library/golang:latest"
  # force application build
  GO_BUILD_MODE: application
  GO_SBOM_OPTS: "-main cmd/tracking_service"

  DOCKER_BUILD_ARGS: "--build-arg CI_PROJECT_URL --build-arg TRACKING_CONFIGURATION"
  DOCKER_HEALTHCHECK_CONTAINER_ARGS: "--service --skip_tracking my-template-service my-template-version"

stages:
  - build
  - test
  - package-build
  - package-test
  - acceptance
  - publish

# override base jobs not to depend on tracking image
.go-base:
  services: []

.docker-base:
  services: []
+4 −5
Original line number Diff line number Diff line
# Default CI/CD configuration file
# ℹ️ If you're using TBC in a self-managed GitLab with a custom TBC root group, use .gitlab-ci-namespaced.yml instead
include:
  # $TBC_NAMESPACE is a group variable; can be globally overridden
  - project: "$TBC_NAMESPACE/golang"
  - project: "to-be-continuous/golang"
    ref: "4.7"
    file: "templates/gitlab-ci-golang.yml"
  - project: "$TBC_NAMESPACE/docker"
  - project: "to-be-continuous/docker"
    ref: "6.1"
    file: "templates/gitlab-ci-docker.yml"

variables:
  # Default value; can be globally overridden
  TBC_NAMESPACE: "to-be-continuous"
  GO_BUILD_FLAGS: -tags netgo
  GO_IMAGE: "docker.io/library/golang:latest"
  # force application build