gitlab-ci Plugin

This plugin creates GitLab CI workflow.

It downloads a template of your choice, renders it with provided parameters, and creates a GitLab CI file for your repo.

Usage

The following content is an example of the “tool file”.

For more information on the main config, the tool file, and the var file of DevStream, see Core Concepts Overview and DevStream Configuration.

Plugin config example:

YAML

  1. tools:
  2. # name of the tool
  3. - name: gitlab-ci
  4. # id of the tool instance
  5. instanceID: default
  6. # format: name.instanceID; If specified, dtm will make sure the dependency is applied first before handling this tool.
  7. dependsOn: [ ]
  8. # options for the plugin
  9. options:
  10. scm:
  11. # scm common field
  12. branch: YOUR_REPO_BRANCH
  13. token: YOUR_REPO_SCM_TOKEN
  14. # you can directly use the url of repo (git@gitlab.com/root/test-exmaple.git for example)
  15. url: YOUR_REPO_URL
  16. # or you can config detailed fields for this repo
  17. owner: YOUR_REPO_OWNER
  18. org: YOUR_REPO_ORG
  19. name: YOUR_REPO_NAME
  20. scmType: gitlab
  21. # you can config this field if you are using self-host gitlab
  22. baseURL: YOUR_SELF_HOST_GITLAB_URL
  23. pipeline:
  24. # configLocation is the location of gitlab ci file, it can be remote or local address,
  25. # if you don't config this field, devstream will use https://raw.githubusercontent.com/devstream-io/dtm-pipeline-templates/main/gitlab-ci/.gitlab-ci.yml
  26. configLocation: .gitlabci.yml
  27. # language config is required
  28. language:
  29. framework: # support gin/flask/spring for now
  30. name: LANGUAGE # support go/java/nodejs/python for now
  31. imageRepo:
  32. # image repo URL for pulling/pushing
  33. url: http://harbor.example.com:80
  34. # image repo user name
  35. user: admin
  36. # image repo password
  37. password: YOUR_IMAGE_REPO_PASSWORD
  38. # whether create gitlab runner for this project
  39. # if runner.enable is true, devstream will use helm to install the project's runner
  40. # and diable shared runner of this project
  41. runner:
  42. enable: false

Notes:

  • scm config option represents codebase location; for more info, you can refer to SCM Config.
  • The pipeline config option controls CI stages; you can refer to Pipeline Config for more info.