Switched to 3.12 and node builder

This commit is contained in:
Jonathan Ervine 2020-07-20 15:09:58 +08:00
parent 99ab89db67
commit cf14ae497b
2 changed files with 34 additions and 18 deletions

View File

@ -1,5 +1,5 @@
# Base on latest (edge) alpine image # Base on latest (edge) alpine image
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.10 FROM harbor.ervine.dev/library/x86_64/alpine/alpine:3.12
MAINTAINER “Jonathan Ervine” <docker@ervine.org> MAINTAINER “Jonathan Ervine” <docker@ervine.org>
@ -7,7 +7,7 @@ MAINTAINER “Jonathan Ervine” <docker@ervine.org>
ENV LANG='en_US.UTF-8' \ ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US.UTF-8' LANGUAGE='en_US.UTF-8'
RUN apk update && apk -U upgrade && apk add python3 git RUN apk update && apk -U upgrade --ignore alpine-baselayout && apk add python3 git openssh-client gcc python3-dev musl-dev libffi-dev openssl-dev
VOLUME /data VOLUME /data

46
Jenkinsfile vendored
View File

@ -1,18 +1,34 @@
node("docker-node") { podTemplate(yaml: """
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { kind: Pod
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251
imagePullPolicy: Always
command:
- /busybox/cat
tty: true
volumeMounts:
- name: jenkins-docker-cfg
mountPath: /kaniko/.docker
volumes:
- name: jenkins-docker-cfg
projected:
sources:
- secret:
name: regcred
items:
- key: .dockerconfigjson
path: config.json
"""
) {
git branch: "3.10.3", url: "ssh://git@git.ervine.org:2222/jonny/alpine-kubespray-installer", credentialsId: 'jenkins-to-git' node(POD_LABEL) {
stage('Build with Kaniko') {
sh "git rev-parse HEAD > .git/commit-id" git 'https://git.ervine.org/jonny/kubespray-installer'
def commit_id = readFile('.git/commit-id').trim() container('kaniko') {
println commit_id sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/htpc-mgr:latest --destination=harbor.ervine.dev/library/x86_64/alpine/htpc-mgr:3.12'
}
stage "build"
def app = docker.build "library/x86_64/alpine/kubespray"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("latest")
app.push("3.10")
} }
}
} }