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
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:
ci:
# If your ci file is local or remote, you can set the this field to get ci file
configLocation: JENKINSFILE_LOCATION
# If you want to config ci in devstream, you can config configContents directly
configContents:
Jenkinsfile: JENKINSFILE_CONTENT
# support jenkins-pipeline/gitlab-ci/github-actions for now
type: jenkins-pipeline
projectRepo:
# scm common field
branch: YOUR_REPO_BRANCH
token: YOUR_REPO_SCM_TOKEN
# you can directly use the url of repo
url: YOUR_REPO_URL
# or you can config detailed fields for this repo
owner: YOUR_REPO_OWNER
org: YOUR_REPO_ORG
name: YOUR_REPO_NAME
scmType: github
# you can config this field if you are using self-host gitlab
baseURL: YOUR_SELF_HOST_GITLAB_URL
Notes:
projectRepo
config option represents codebase location; for more info, you can refer to SCM Config.ci.localPath
andci.remoteURL
can’t be empty at the same time.- if your
projectRepo.scmType
isgitlab
, theci.type
is not allowed to begithub-actions
. - if your
projectRepo.scmType
isgithub
, theci.type
is not allowed to begitlab-ci
.
Example
Local WorkFlows With Github
YAML
tools:
- name: ci-generic
instanceID: test-github
options:
ci:
localPath: workflows
type: github
projectRepo:
owner: devstream
org: ""
name: test-repo
branch: main
scmType: 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: ""
name: test-repo
branch: main
scmType: gitlab
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.