gitlab-ci 插件

该插件用于在使用 gitlab 的项目仓库中创建 Gitlab CI 并运行对应项目的 gitlab runner。

配置项

下面的内容是一个示例配置文件用于创建 Gitlab CI:

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

注意:

  • scm 配置字段用于表示代码仓库的配置信息,具体配置可查看SCM配置项
  • pipeline 选项项用于控制 CI 流程中的各个阶段,具体配置可查看文档pipline配置项