Skip to content

ci-generic plugin

This plugin installs ci script in GitLib/GitHub repo from local or remote url.

Usage

YAML
tools:
# name of the tool
- name: ci-generic
  # id of the tool instance
  instanceID: default
  # format: name.instanceID; If specified, dtm will make sure the dependency is applied first before handling this tool.
  dependsOn: [ ]
  # options for the plugin
  options:
  # TODO(dtm): Add your default config here.

Field Configs

key description
ci.localPath If your ci file is local, you can set the this field to the ci file location, which can be a directory or a file
ci.remoteURL If your ci file is remote, you can set this field to url address
ci.type ci type, support gitlab, github, jenkins for now
projectRepo.owner destination repo owner
projectRepo.org destination repo org
projectRepo.repo destination repo name
projectRepo.branch destination repo branch
projectRepo.repoType destination repo type, support github/gitlab for now
projectRepo.baseURL if you use self-build gitlab, you can set this field to gitlab address
projectRepo.visibility if you use gitlab, you can set this field for repo permission

Notes:

  • ci.localPath and ci.remoteURL can't be empty at the same time.
  • if you set both ci.localPath and ci.remoteURL, ci.localPath will be used.
  • if your projectRepo.repoType is gitlab, the ci.type is not allowed to be github.
  • if your projectRepo.repoType is github, the ci.type is not allowed to be gitlab.

Example

Local WorkFlows With Github

YAML
tools:
  - name: ci-generic
    instanceID: test-github
    options:
      ci:
        localPath: workflows
        type: github
      projectRepo:
        owner: devstream
        org: ""
        repo: test-repo
        branch: main
        repoType: github

This config will put local workflows directory to GitHub repo's .github/workflows directory.

Remote Jenkinsfile With Gitlab

YAML
tools:
  - name: ci-generic
    instanceID: test-gitlab
    options:
      ci:
        remoteURL : https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile
        type: jenkins
      projectRepo:
        owner: root
        org: ""
        repo: test-repo
        branch: main
        repoType: gitlab
        baseURL: http://127.0.0.1:30000

This config will put file from remote to GitLab repo.