ci-generic Plugin

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

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.

YAML

  1. tools:
  2. # name of the tool
  3. - name: ci-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. ci:
  11. # If your ci file is local or remote, you can set the this field to get ci file
  12. configLocation: JENKINSFILE_LOCATION
  13. # If you want to config ci in devstream, you can config configContents directly
  14. configContents:
  15. Jenkinsfile: JENKINSFILE_CONTENT
  16. # support jenkins-pipeline/gitlab-ci/github-actions for now
  17. type: jenkins-pipeline
  18. projectRepo:
  19. # scm common field
  20. branch: YOUR_REPO_BRANCH
  21. token: YOUR_REPO_SCM_TOKEN
  22. # you can directly use the url of repo
  23. url: YOUR_REPO_URL
  24. # or you can config detailed fields for this repo
  25. owner: YOUR_REPO_OWNER
  26. org: YOUR_REPO_ORG
  27. name: YOUR_REPO_NAME
  28. scmType: github
  29. # you can config this field if you are using self-host gitlab
  30. baseURL: YOUR_SELF_HOST_GITLAB_URL

Notes:

  • projectRepo config option represents codebase location; for more info, you can refer to SCM Config.
  • ci.localPath and ci.remoteURL can’t be empty at the same time.
  • if your projectRepo.scmType is gitlab, the ci.type is not allowed to be github-actions.
  • if your projectRepo.scmType is github, the ci.type is not allowed to be gitlab-ci.

Example

Local WorkFlows With Github

YAML

  1. tools:
  2. - name: ci-generic
  3. instanceID: test-github
  4. options:
  5. ci:
  6. localPath: workflows
  7. type: github
  8. projectRepo:
  9. owner: devstream
  10. org: ""
  11. name: test-repo
  12. branch: main
  13. scmType: github

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

Remote Jenkinsfile With Gitlab

YAML

  1. tools:
  2. - name: ci-generic
  3. instanceID: test-gitlab
  4. options:
  5. ci:
  6. remoteURL : https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile
  7. type: jenkins
  8. projectRepo:
  9. owner: root
  10. org: ""
  11. name: test-repo
  12. branch: main
  13. scmType: gitlab
  14. baseURL: http://127.0.0.1:30000

This config will put files from remote](https://raw.githubusercontent.com/DeekshithSN/Jenkinsfile/inputTest/Jenkinsfile)\ to GitLab repo.