-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🍀 Proposal
: Add a plugin to create a Jenkins pipeline
#582
Comments
@prodanlabs Thank you very much for the proposal and there is a great demo screenshot. For this plugin, maybe we need more detailed design before we can start development. For example, the password/token fields in the configuration file may not be suitable to save directly in plain text. Also as you mentioned, jenkins can interface with docker, k8s, vm and many more, so which one should we implement first? Does one plugin support all of them? Also we already have a For pipeline, I think it's a good idea to start with the |
To be honest, in |
Jenkins |
Hi @daniel-hutao do you have any suggestions? toolFile: config.yaml
tools:
- name: jenkins-k8s-pipeline
instanceID: demo
options:
git:
url: "https://github.com/prodanlabs/tekton-examples.git"
branch: "main"
credentialID: "1111" # Jenkins credential id
jenkinsURL: "http://124.71.14.222:31765"
jobName: devstream-auto
pod: # kubernetes pod template
label: "test"
container:
- name: "jnlp"
image: "jenkins/inbound-agent:latest-alpine"
- name: "golang"
image: "golang:alpine3.15"
command:
- sleep
args:
- 600s
Env:
- key: 'CGO_ENABLED'
value: '0'
- key: 'CGO_ENABLED_EE'
value: '0'
volumes:
emptyDirVolume:
- mountPath: "/tmp"
- mountPath: "/tmp22"
secretVolume:
- mountPath: "/test"
secretName: "test"
- mountPath: "/test2"
secretName: "test2"
pipeline: # Jenkins Pipeline template
environment:
- key: 'PPPP'
value: '22'
stages:
- name: "Git Clone"
container: "jnlp"
gitClone: true
- name: "Go Test"
container: "golang"
script: |-
cd ${WORKSPACE}/
go version
go test
state:
backend: local
options:
stateFile: devstream.state |
Environment variables use |
The discussion about this plugin seems to have stopped, I don't know how it's going. There is no doubt that the In addition, for some of the work I have done on this plugin, I can submit a PR as a reference like #650. It doesn't matter if it's modified on my PR submitted or resubmitted by the community. |
Hi @prodanlabs, We are sorry that this issue didn't get enough attention from the PMC. Please do keep in mind that we are a tiny PMC consisting of only 2 members at the moment, and we have a not-so-tiny backlog to work through. It doesn't mean this isn't an important issue; I hope you keep it in mind. I have the following concerns regarding this issue: 1. Jenkins Installation/ConfigurationIn order for the "jenkins-k8s-worker" to work:
I.E., if the user didn't use our existing jenkins plugin to install jenkins, but tries to use this plugin directly on an existing jenkins instance, it doesn't work. I have a proposal: add a possibility to "fill in the k8s plugin config" as shown here. 2. Pipeline DefinitionMost users define podTemplate directly in their Jeninsfile and put that Jenkinsfile in their repo. An example of the Jenkinsfile: podTemplate(containers: [
containerTemplate(name: 'maven', image: 'maven:3.8.1-jdk-8', command: 'sleep', args: '99d'),
containerTemplate(name: 'golang', image: 'golang:1.16.5', command: 'sleep', args: '99d')
]) {
node(POD_LABEL) {
stage('Get a Maven project') {
git 'https://github.com/jenkinsci/kubernetes-plugin.git'
container('maven') {
stage('Build a Maven project') {
sh 'mvn -B -ntp clean install'
}
}
}
stage('Get a Golang project') {
git url: 'https://github.com/hashicorp/terraform.git', branch: 'main'
container('golang') {
stage('Build a Go project') {
sh '''
mkdir -p /go/src/github.com/hashicorp
ln -s `pwd` /go/src/github.com/hashicorp/terraform
cd /go/src/github.com/hashicorp/terraform && make
'''
}
}
}
}
} I would argue that:
Based on the above thoughts, I have the following ideas:
Benefits:
|
We are planning a plugin to create a jenkins job, and in the job, we will define a git repo to read the Jenkins file. @aFlyBird0 please follow up on this one. |
Sorry, I don't have time to follow up right now. Interested friends can pick it up. |
#1148 has add jenkinsfile pipeline for this issue |
What Would You Like to Add? Why is This Needed?
Design
question
Generally speaking, large open source projects will not use inactive third-party libraries. I spent an hour implementing a simple Jenkins REST client,like this:
What do you think about this plugin? This plugin is still a demo :)
Anything else
The text was updated successfully, but these errors were encountered: