Switched to node builder
This commit is contained in:
parent
6bf734f05e
commit
d679b0176b
@ -8,10 +8,6 @@ ENV LANG='en_US.UTF-8' \
|
|||||||
LANGUAGE='en_US.UTF-8' \
|
LANGUAGE='en_US.UTF-8' \
|
||||||
TERM='xterm' \
|
TERM='xterm' \
|
||||||
VERSION='develop' \
|
VERSION='develop' \
|
||||||
APP_USER='mediaservice' \
|
|
||||||
APP_GROUP='mediaservice' \
|
|
||||||
APP_UID='1003' \
|
|
||||||
APP_GID='1003'
|
|
||||||
|
|
||||||
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
|
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
|
||||||
apk -U update && \
|
apk -U update && \
|
||||||
@ -21,6 +17,5 @@ RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositorie
|
|||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
COPY start.sh /usr/local/bin/start.sh
|
COPY start.sh /usr/local/bin/start.sh
|
||||||
RUN chmod 755 /usr/local/bin/start.sh
|
|
||||||
|
|
||||||
CMD [ "/usr/local/bin/start.sh" ]
|
CMD [ "/usr/local/bin/start.sh" ]
|
||||||
|
|||||||
52
Jenkinsfile
vendored
52
Jenkinsfile
vendored
@ -1,24 +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: "master", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-db-sidecar", credentialsId: 'jenkins-to-git'
|
node(POD_LABEL) {
|
||||||
|
stage('Build with Kaniko') {
|
||||||
sh "git rev-parse HEAD > .git/commit-id"
|
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-sidecar.git', credentialsId: 'jenkins-to-git'
|
||||||
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/db-sidecar:3.12'
|
||||||
|
}
|
||||||
try {
|
|
||||||
stage "build"
|
|
||||||
def app = docker.build "library/x86_64/alpine/db-sidecar"
|
|
||||||
|
|
||||||
stage "publish"
|
|
||||||
app.push("${env.BUILD_NUMBER}")
|
|
||||||
app.push("3.12")
|
|
||||||
app.push("latest")
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user