Switched to node builder
This commit is contained in:
parent
1509425c99
commit
50b608438a
@ -1,5 +1,5 @@
|
||||
# Base on latest (edge) alpine image
|
||||
FROM opensuse/leap:15.1
|
||||
FROM opensuse/leap:15.2
|
||||
|
||||
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
||||
|
||||
@ -27,9 +27,8 @@ RUN wget https://github.com/smallstep/certificates/releases/download/v$STEP_VERS
|
||||
|
||||
RUN wget https://github.com/smallstep/cli/releases/download/v$STEP_VERSION/step_linux_$STEP_VERSION\_amd64.tar.gz && \
|
||||
tar zxvf step_linux_$STEP_VERSION\_amd64.tar.gz -C /tmp/ && \
|
||||
mv /tmp/step_$STEP_VERSION/bin/step /usr/local/bin/
|
||||
|
||||
RUN rm -rf step_linux_$STEP_VERSION\_amd64.tar.gz /tmp/step_$STEP_VERSION /tmp/step-certificates_$STEP_VERSION
|
||||
mv /tmp/step_$STEP_VERSION/bin/step /usr/local/bin/ && \
|
||||
rm -rf step_linux_$STEP_VERSION\_amd64.tar.gz /tmp/step_$STEP_VERSION /tmp/step-certificates_$STEP_VERSION
|
||||
|
||||
EXPOSE 9000/tcp
|
||||
|
||||
|
||||
52
Jenkinsfile
vendored
52
Jenkinsfile
vendored
@ -1,23 +1,35 @@
|
||||
node("docker-node") {
|
||||
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||
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
|
||||
"""
|
||||
) {
|
||||
|
||||
git branch: "master", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-suse-stepCA", 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"
|
||||
|
||||
stage "publish"
|
||||
app.push("${env.BUILD_NUMBER}")
|
||||
app.push("latest")
|
||||
app.push("0.14.3")
|
||||
}
|
||||
catch (err) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
node(POD_LABEL) {
|
||||
stage('Build with Kaniko') {
|
||||
git url: 'ssh://git@git.ervine.org/jonny/x86_64-suse-stepCA.git', credentialsId: 'jenkins-to-git'
|
||||
container('kaniko') {
|
||||
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/suse/stepca:0.14.3'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user