代码拉取完成,页面将自动刷新
同步操作将从 Thoughtworks/fabric-ca 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
def getRepoURL() {
sh "git config --get remote.origin.url > .git/remote-url"
return readFile(".git/remote-url").trim()
}
def projectName = "hyperledger/fabric-ca"
void setBuildStatus(String message, String state) {
repoUrl = getRepoURL()
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: repoUrl],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}
pipeline {
agent any
environment {
DOCKER_NS = "twblockchain"
EXTRA_VERSION = "build-${BUILD_NUMBER}"
GOPATH = "${WORKSPACE}/gopath"
}
stages {
stage('Build Image') {
steps {
setBuildStatus("Build Started", "PENDING");
dir("gopath/src/github.com/$projectName") {
checkout scm
sh '''
make clean docker
'''
}
}
}
stage('Upload Image') {
steps {
dir("gopath/src/github.com/$projectName") {
sh '''
make docker-list 2>/dev/null | grep "$DOCKER_NS" | while read line
do
docker tag $line ${line/:*/:latest}
docker push $line
docker push ${line/:*/:latest}
docker rmi $line
docker rmi ${line/:*/:latest}
done
'''
}
}
}
stage('Test Fabcar') {
steps {
dir("gopath/src/github.com/$projectName") {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
script {
def result = build(
job: 'fabric-samples',
propagate: false,
parameters: [
[$class: 'StringParameterValue', name: 'BYFN_CA', value: 'yes'],
[$class: 'StringParameterValue', name: 'IMAGE_CA', value: sh(script: 'make fabric-ca-docker-list 2>/dev/null ', returnStdout: true).trim()],
]
)
if (result.result.equals("SUCCESS")) {
echo "Passed Test Fabcar"
} else {
error "Failed Test Fabcar"
}
}
}
}
}
}
}
post {
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
unsuccessful {
setBuildStatus("Build failed", "FAILURE");
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。