gitlabci-generic Plugin

This plugin creates Golang GitLab CI workflow.

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

Usage

This plugin depends on an environment variable “GITLAB_TOKEN”, which is your GitLab personal access token.

TL;DR: if you are using gitlab.com (instead of a self-hosted GitLab), click here to create a token for DevStream (the scope contains API only.)

If you are using self-hosted GitLab, refer to the official doc here for more info.

Note: when creating the token, make sure you select “API” in the “scopes” section, as DevStream uses GitLab API to add CI workflow files.

Plugin config example:

  1. tools:
  2. # name of the tool
  3. - name: gitlabci-generic
  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. # owner/repo; "path with namespace" is only GitLab API's way of saying the same thing; please change the values below.
  11. pathWithNamespace: YOUR_GITLAB_USERNAME/YOUR_GITLAB_REPO_NAME
  12. # main branch of the repo (to which branch the plugin will submit the workflows)
  13. branch: main
  14. # url of the GitLab CI template
  15. templateURL: https://someplace.com/to/download/your/template
  16. # custom variables keys and values
  17. templateVariables:
  18. key1: value1
  19. key2: value2

Or, run dtm show config --plugin=gitlabci-generic to get the default config.

All parameters are mandatory.