Commit 913a7ea5 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 271cc577
Loading
Loading
Loading
Loading
Loading
+48 −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
  # Angular template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/angular/gitlab-ci-angular@4
    inputs:
      cli-image: "docker.io/trion/ng-cli-karma:20.1.0"
      build-args: "build --configuration production"
      lint-args: "version"
      semgrep-disabled: true
  # Playwright template
  # - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/playwright/gitlab-ci-playwright@1
  #   inputs:
  #     image: 'mcr.microsoft.com/playwright:v1.45.2-jammy'
  #     review-enabled: true
  # S3 template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/s3/gitlab-ci-s3@7
    inputs:
      # deploy: landing page (static/), mkdocs build (public/), Angular build (kicker/dist/) and aggregated kicker (kicker-aggregated/)
      deploy-files: "dist/kicker/browser/"
      prod-disabled: true
      staging-disabled: true
      review-prefix: ${CI_COMMIT_REF_SLUG}

# override Angular build job to run build only (no tests)
ng-build:
  script:
    # collect environment variables
    - ng run kicker:collect-vars
    # build production artifact
    - ng $NG_BUILD_ARGS --no-progress

# publish on GitLab pages: only on main
pages:
  stage: deploy
  script:
    - cp -rf dist/kicker/browser public
    # generate build.info
    - echo -e "Build date= $(date)\nGit Commit Ref= $CI_COMMIT_REF_NAME\nGit Commit SHA= $CI_COMMIT_SHA\n" > public/build.info
  artifacts:
    name: "kicker app from $CI_COMMIT_REF_SLUG"
    paths:
      - public
    expire_in: 1 day
  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+5 −8
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
  # Angular template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/angular/gitlab-ci-angular@4
  - component: $CI_SERVER_FQDN/to-be-continuous/angular/gitlab-ci-angular@4
    inputs:
      cli-image: "docker.io/trion/ng-cli-karma:20.1.0"
      build-args: "build --configuration production"
      lint-args: "version"
      semgrep-disabled: true
  # Playwright template
  # - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/playwright/gitlab-ci-playwright@1
  # - component: $CI_SERVER_FQDN/to-be-continuous/playwright/gitlab-ci-playwright@1
  #   inputs:
  #     image: 'mcr.microsoft.com/playwright:v1.45.2-jammy'
  #     review-enabled: true
  # S3 template
  - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/s3/gitlab-ci-s3@7
  - component: $CI_SERVER_FQDN/to-be-continuous/s3/gitlab-ci-s3@7
    inputs:
      # deploy: landing page (static/), mkdocs build (public/), Angular build (kicker/dist/) and aggregated kicker (kicker-aggregated/)
      deploy-files: "dist/kicker/browser/"
@@ -21,10 +22,6 @@ include:
      staging-disabled: true
      review-prefix: ${CI_COMMIT_REF_SLUG}

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

# override Angular build job to run build only (no tests)
ng-build:
  script: