From c45efb84bdcfc54032977dbc88cd874bfdf357f1 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 28 Apr 2020 22:21:05 +0800 Subject: [PATCH] new file: Jenkinsfile Added Jenkinsfile --- Jenkinsfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..3ca7bd9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,23 @@ +node("docker-node") { + docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { + + git branch: "master", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-suse-step_bootstrap", credentialsId: 'jenkins-to-git' + + sh "git rev-parse HEAD > .git/commit-id" + def commit_id = readFile('.git/commit-id').trim() + println commit_id + + try { + stage "build" + def app = docker.build "library/x86_64/suse/stepca_bootstrap" + + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + app.push("0.14.3") + } + catch (err) { + currentBuild.result = 'FAILURE' + } + } +}