Add cicd pipeline
This commit is contained in:
parent
515e0edb5a
commit
8bd601d200
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
pipelineJob('build-jenkins-operator') {
|
||||
displayName('Build jenkins-operator')
|
||||
|
||||
definition {
|
||||
cpsScm {
|
||||
scm {
|
||||
git {
|
||||
remote {
|
||||
url('https://github.com/VirtusLab/jenkins-operator.git')
|
||||
credentials('jenkins-operator')
|
||||
}
|
||||
branches('*/master')
|
||||
}
|
||||
}
|
||||
scriptPath('cicd/pipelines/build.jenkins')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
def label = "build-jenkins-operator-${UUID.randomUUID().toString()}"
|
||||
def home = "${JENKINS_HOME}"
|
||||
def workspace = "${home}/workspace/build-jenkins-operator"
|
||||
def workdir = "${workspace}/src/github.com/VirtusLab/jenkins-operator/"
|
||||
|
||||
podTemplate(label: label,
|
||||
containers: [
|
||||
containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:alpine'),
|
||||
containerTemplate(name: 'go', image: 'golang:1-alpine', command: 'cat', ttyEnabled: true),
|
||||
]) {
|
||||
|
||||
node(label) {
|
||||
dir(workdir) {
|
||||
stage('Init') {
|
||||
timeout(time: 3, unit: 'MINUTES') {
|
||||
checkout scm
|
||||
}
|
||||
container('go') {
|
||||
sh 'apk --no-cache --update add make git gcc libc-dev'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
container('go') {
|
||||
sh 'make build'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,14 +6,8 @@ spec:
|
|||
master:
|
||||
image: jenkins/jenkins
|
||||
seedJobs:
|
||||
- id: jenkins-operator-e2e
|
||||
- id: jenkins-operator
|
||||
targets: "cicd/jobs/*.jenkins"
|
||||
description: "Jenkins Operator e2e tests repository"
|
||||
description: "Jenkins Operator repository"
|
||||
repositoryBranch: master
|
||||
repositoryUrl: https://github.com/VirtusLab/jenkins-operator-e2e.git
|
||||
# Use configuration below if your GitHub repository is private
|
||||
# repositoryUrl: git@github.com:VirtusLab/jenkins-operator-e2e.git
|
||||
# privateKey:
|
||||
# secretKeyRef:
|
||||
# name: deploy-keys
|
||||
# key: jenkins-operator-e2e
|
||||
repositoryUrl: https://github.com/VirtusLab/jenkins-operator.git
|
||||
|
|
|
|||
Loading…
Reference in New Issue