Commit ee6e526b 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 d48db818
Loading
Loading
Loading
Loading
+45 −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
  # Docker template
  - component: "$CI_SERVER_FQDN/$TBC_NAMESPACE/docker/gitlab-ci-docker@8"
    inputs:
      healthcheck-disabled: true
      build-args: "--cache-ttl=6h"
      prod-publish-strategy: "auto"
      release-extra-tags: "latest \\g<major>.\\g<minor>\\g<build> \\g<major>\\g<build>"
  # Python template
  - component: "$CI_SERVER_FQDN/$TBC_NAMESPACE/python/gitlab-ci-python@9"
    inputs:
      image: "docker.io/library/python:3.12-slim"
      ruff-enabled: true
      package-enabled: true
      publish-enabled: true
      semgrep-disabled: true
  # semantic-release template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/semantic-release/gitlab-ci-semrel@4
    inputs:
      # disable semrel for all synch'd repositories
      release-disabled: true
      auto-release-enabled: true

dry-run-test:
  image:
    name: "$DOCKER_SNAPSHOT_IMAGE"
    entrypoint: [""]
  stage: package-test
  variables:
    SRC_GITLAB_API: https://gitlab.com/api/v4
    SRC_SYNC_PATH: to-be-continuous
    DEST_GITLAB_API: https://gitlab.com/api/v4
    DEST_SYNC_PATH: tbc-offtracks/to-be-continuous
    MAX_VISIBILITY: private
    EXCLUDE: samples
    # DEST_TOKEN is declared as a project secret variable
  script:
    - gitlab-cp --dry-run
  rules:
    # run only on original project on gitlab.com
    - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "$TBC_NAMESPACE/tools/gitlab-cp"'
+6 −9
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
  # Docker template
  - component: "$CI_SERVER_FQDN/$TBC_NAMESPACE/docker/gitlab-ci-docker@8"
  - component: "$CI_SERVER_FQDN/to-be-continuous/docker/gitlab-ci-docker@8"
    inputs:
      healthcheck-disabled: true
      build-args: "--cache-ttl=6h"
      prod-publish-strategy: "auto"
      release-extra-tags: "latest \\g<major>.\\g<minor>\\g<build> \\g<major>\\g<build>"
  # Python template
  - component: "$CI_SERVER_FQDN/$TBC_NAMESPACE/python/gitlab-ci-python@9"
  - component: "$CI_SERVER_FQDN/to-be-continuous/python/gitlab-ci-python@9"
    inputs:
      image: "docker.io/library/python:3.12-slim"
      ruff-enabled: true
@@ -16,16 +17,12 @@ include:
      publish-enabled: true
      semgrep-disabled: true
  # semantic-release template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/semantic-release/gitlab-ci-semrel@4
  - component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@4
    inputs:
      # disable semrel for all synch'd repositories
      release-disabled: true
      auto-release-enabled: true

variables:
  # Default value; can be globally overridden
  TBC_NAMESPACE: "to-be-continuous"

dry-run-test:
  image:
    name: "$DOCKER_SNAPSHOT_IMAGE"
@@ -43,4 +40,4 @@ dry-run-test:
    - gitlab-cp --dry-run
  rules:
    # run only on original project on gitlab.com
    - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "$TBC_NAMESPACE/tools/gitlab-cp"'
    - if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "to-be-continuous/tools/gitlab-cp"'