Compare commits
No commits in common. "master" and "3.11.6" have entirely different histories.
12
Dockerfile
12
Dockerfile
@ -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.12
|
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11
|
||||||
|
|
||||||
LABEL maintainer “Jonathan Ervine” <docker@ervine.org> architecture="x86_64" date="17022020"
|
LABEL maintainer “Jonathan Ervine” <docker@ervine.org> architecture="x86_64" date="17022020"
|
||||||
|
|
||||||
@ -11,8 +11,13 @@ 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 --ignore alpine-baselayout && \
|
apk -U upgrade && \
|
||||||
apk -U add python py-lxml py-simplejson openssl py-openssl
|
apk -U add \
|
||||||
|
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 && \
|
||||||
@ -26,4 +31,5 @@ COPY start.sh /usr/local/bin/start.sh
|
|||||||
|
|
||||||
EXPOSE 5050
|
EXPOSE 5050
|
||||||
|
|
||||||
|
|
||||||
CMD [ "/usr/local/bin/start.sh" ]
|
CMD [ "/usr/local/bin/start.sh" ]
|
||||||
|
|||||||
54
Jenkinsfile
vendored
54
Jenkinsfile
vendored
@ -1,34 +1,26 @@
|
|||||||
podTemplate(yaml: """
|
node("docker-node") {
|
||||||
kind: Pod
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||||
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) {
|
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-cp", credentialsId: 'jenkins-to-git'
|
||||||
stage('Build with Kaniko') {
|
|
||||||
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-cp.git', credentialsId: 'jenkins-to-git'
|
sh "git rev-parse HEAD > .git/commit-id"
|
||||||
container('kaniko') {
|
def commit_id = readFile('.git/commit-id').trim()
|
||||||
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'
|
println commit_id
|
||||||
}
|
|
||||||
|
try {
|
||||||
|
stage "build"
|
||||||
|
def app = docker.build "library/x86_64/alpine/couchpotato"
|
||||||
|
|
||||||
|
stage "publish"
|
||||||
|
app.push("${env.BUILD_NUMBER}")
|
||||||
|
app.push("latest")
|
||||||
|
|
||||||
|
stage('Deploy on K8s'){
|
||||||
|
sh "/usr/local/bin/kubectl -n media delete po cp-0 && kubectl -n media delete po cp-kids-0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user