Using node builder
This commit is contained in:
parent
15ae7e32f6
commit
4e3c0f60c5
@ -1,5 +1,5 @@
|
||||
# Base on latest (edge) alpine image
|
||||
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11
|
||||
FROM harbor.ervine.dev/library/x86_64/alpine/alpine:3.12
|
||||
|
||||
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
||||
|
||||
@ -14,7 +14,7 @@ ENV LANG='en_US.UTF-8' \
|
||||
|
||||
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
|
||||
apk update && \
|
||||
apk -U upgrade && \
|
||||
apk -U upgrade --ignore alpine-baselayout && \
|
||||
apk -U add \
|
||||
transmission-daemon && \
|
||||
wget https://github.com/Secretmapper/combustion/archive/release.zip && \
|
||||
|
||||
56
Jenkinsfile
vendored
56
Jenkinsfile
vendored
@ -1,27 +1,35 @@
|
||||
node("docker-node") {
|
||||
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||
|
||||
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-transmission", 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/alpine/transmission"
|
||||
|
||||
stage "publish"
|
||||
app.push("${env.BUILD_NUMBER}")
|
||||
app.push("latest")
|
||||
|
||||
stage('Deploy on K8s'){
|
||||
sh "/usr/local/bin/kubectl -n media delete po transmission-0"
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
podTemplate(yaml: """
|
||||
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
|
||||
"""
|
||||
) {
|
||||
|
||||
node(POD_LABEL) {
|
||||
stage('Build with Kaniko') {
|
||||
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-transmission.git', credentialsId: 'jenkins-to-git'
|
||||
container('kaniko') {
|
||||
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/transmission:latest --destination=harbor.ervine.dev/library/x86_64/alpine/transmission:3.12.0 --destination=harbor.ervine.dev/library/x86_64/alpine/transmission:3.12'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user