Switched to node builder
This commit is contained in:
parent
6f2d50163d
commit
b197a23af2
10
Dockerfile
10
Dockerfile
@ -11,13 +11,8 @@ ENV LANG='en_US.UTF-8' \
|
|||||||
|
|
||||||
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 update && \
|
apk update && \
|
||||||
apk -U upgrade && \
|
apk -U upgrade --ignore alpine-baselayout && \
|
||||||
apk -U add \
|
apk -U add python py-lxml py-simplejson openssl py-openssl
|
||||||
python \
|
|
||||||
py-lxml \
|
|
||||||
py-simplejson \
|
|
||||||
openssl \
|
|
||||||
py-openssl
|
|
||||||
|
|
||||||
RUN wget https://github.com/CouchPotato/CouchPotatoServer/archive/$VERSION.tar.gz -O couchpotato.tar.gz && \
|
RUN wget https://github.com/CouchPotato/CouchPotatoServer/archive/$VERSION.tar.gz -O couchpotato.tar.gz && \
|
||||||
tar zxvf couchpotato.tar.gz && \
|
tar zxvf couchpotato.tar.gz && \
|
||||||
@ -31,5 +26,4 @@ COPY start.sh /usr/local/bin/start.sh
|
|||||||
|
|
||||||
EXPOSE 5050
|
EXPOSE 5050
|
||||||
|
|
||||||
|
|
||||||
CMD [ "/usr/local/bin/start.sh" ]
|
CMD [ "/usr/local/bin/start.sh" ]
|
||||||
|
|||||||
56
Jenkinsfile
vendored
56
Jenkinsfile
vendored
@ -1,26 +1,34 @@
|
|||||||
node("docker-node") {
|
podTemplate(yaml: """
|
||||||
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
kind: Pod
|
||||||
|
spec:
|
||||||
git branch: "master", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-cp", credentialsId: 'jenkins-to-git'
|
containers:
|
||||||
|
- name: kaniko
|
||||||
sh "git rev-parse HEAD > .git/commit-id"
|
image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251
|
||||||
def commit_id = readFile('.git/commit-id').trim()
|
imagePullPolicy: Always
|
||||||
println commit_id
|
command:
|
||||||
|
- /busybox/cat
|
||||||
try {
|
tty: true
|
||||||
stage "build"
|
volumeMounts:
|
||||||
def app = docker.build "library/x86_64/alpine/couchpotato"
|
- name: jenkins-docker-cfg
|
||||||
|
mountPath: /kaniko/.docker
|
||||||
stage "publish"
|
volumes:
|
||||||
app.push("${env.BUILD_NUMBER}")
|
- name: jenkins-docker-cfg
|
||||||
app.push("latest")
|
projected:
|
||||||
|
sources:
|
||||||
stage('Deploy on K8s'){
|
- secret:
|
||||||
sh "/usr/local/bin/kubectl -n media delete po cp-0 && kubectl -n media delete po cp-kids-0"
|
name: regcred
|
||||||
}
|
items:
|
||||||
}
|
- key: .dockerconfigjson
|
||||||
catch (err) {
|
path: config.json
|
||||||
currentBuild.result = 'FAILURE'
|
"""
|
||||||
}
|
) {
|
||||||
|
|
||||||
|
node(POD_LABEL) {
|
||||||
|
stage('Build with Kaniko') {
|
||||||
|
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-cp.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/cp:3.12.0 --destination=harbor.ervine.dev/library/x86_64/alpine/cp:3.12'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user