Added public repo destination

This commit is contained in:
Jonathan Ervine 2020-07-26 21:47:00 +08:00
parent 0cee30513e
commit 9522eb01b8
2 changed files with 1 additions and 19 deletions

2
Jenkinsfile vendored
View File

@ -27,7 +27,7 @@ spec:
stage('Build with Kaniko') {
git 'https://git.ervine.org/jonny/x86_64-alpine.git'
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine:latest --destination=harbor.ervine.dev/library/x86_64/alpine:3.12.0 --destination=harbor.ervine.dev/library/x86_64/alpine:3.12'
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/public/x86_64/alpine:v3.12.0 --destination=harbor.ervine.dev/public/x86_64/alpine:v3.12 --destination=harbor.ervine.dev/library/x86_64/alpine:3.12.0 --destination=harbor.ervine.dev/library/x86_64/alpine:3.12'
}
}
}

View File

@ -1,18 +0,0 @@
node("docker-node") {
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
git branch: "master", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine", credentialsId: 'jenkins-to-git'
sh "git rev-parse HEAD > .git/commit-id"
def commit_id = readFile('.git/commit-id').trim()
println commit_id
stage "build"
def app = docker.build "library/x86_64/alpine/alpine"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("latest")
app.push("3.12")
}
}