GitLab pipelines in the SourceCraft CI/CD

SourceCraft CI/CD workflows support pipelines with GitLab syntax.

This allows transferring projects from GitLab without any major CI/CD reconfiguration and reusing the extensive library of existing pipeline examples.

Warning

Only cloud workers support running GitHub Actions or GitLab pipelines in SourceCraft CI/CD.

GitLab pipelines are embedded into the CI/CD configuration, .sourcecraft/ci.yaml, as separate cubes with the gitlab_workflow parameter. For example:

on:
  push:
    - workflows: [sample-workflow]
      filter:
        branches: ["main"]

workflows:
  sample-workflow:
    tasks:
      - name: demo-gitlab-ci
        cubes:
          - name: run-gitlab-workflow
            # Path to the GitLab pipeline configuration file
            gitlab_workflow: .sourcecraft/.gitlab-ci.yaml
Example of a GitLab pipeilne, .gilab-ci.yaml
build-job:
  stage: build
  script:
    - echo "Hello, GitLab CI/CD!"

test-job1:
  stage: test
  script:
    - echo "This job tests something"

test-job2:
  stage: test
  script:
    - echo "This job tests something, but takes more time than test-job1."
    - echo "After the echo commands complete, it runs the sleep command for 20 seconds"
    - echo "which simulates a test that runs 20 seconds longer than test-job1"
    - sleep 20

deploy-prod:
  stage: deploy
  script:
    - echo "This job deploys something."

Supported GitLab pipeline syntax elements:

Alert

SourceCraft does not support these GitLab pipeline syntax elements:

Tip

You can set up and view repository configurations in the SourceCraft interface under Repository settings in the Configurations section. For more information, see Setting up repository configurations as code.

See also