加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
pipeline {
agent {
label "jenkins-go"
}
environment {
GH_CREDS = credentials('jenkins-x-github')
BUILD_NUMBER = "$BUILD_NUMBER"
GIT_USERNAME = "$GH_CREDS_USR"
GIT_API_TOKEN = "$GH_CREDS_PSW"
GITHUB_ACCESS_TOKEN = "$GH_CREDS_PSW"
JOB_NAME = "$JOB_NAME"
BRANCH_NAME = "$BRANCH_NAME"
}
stages {
stage('CI Build and Test') {
when {
branch 'PR-*'
}
steps {
dir ('/home/jenkins/go/src/github.com/jenkins-x/jx') {
checkout scm
container('go') {
sh "make"
sh "make test"
sh "./build/jx --help"
sh "make preview"
}
}
}
}
stage('Build and Release') {
when {
branch 'master'
}
steps {
dir ('/home/jenkins/go/src/github.com/jenkins-x/jx') {
checkout scm
container('go') {
sh "echo \$(jx-release-version) > pkg/version/VERSION"
sh "make release"
}
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化