Switched to node builder
This commit is contained in:
parent
caee10c44f
commit
25f8884f1e
@ -15,7 +15,7 @@ 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 -U update && \
|
apk -U update && \
|
||||||
apk -U upgrade && \
|
apk -U upgrade --ignore alpine-baselayout && \
|
||||||
apk -U add \
|
apk -U add \
|
||||||
libmediainfo \
|
libmediainfo \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -26,7 +26,6 @@ RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositorie
|
|||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
ADD start.sh /usr/local/bin/start.sh
|
ADD start.sh /usr/local/bin/start.sh
|
||||||
RUN chmod 755 /usr/local/bin/start.sh
|
|
||||||
|
|
||||||
RUN wget https://update.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz -O nzbdrone.tar.gz && \
|
RUN wget https://update.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz -O nzbdrone.tar.gz && \
|
||||||
tar zxvf nzbdrone.tar.gz && \
|
tar zxvf nzbdrone.tar.gz && \
|
||||||
|
|||||||
55
Jenkinsfile
vendored
55
Jenkinsfile
vendored
@ -1,26 +1,35 @@
|
|||||||
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-sonarr", 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
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
) {
|
||||||
|
|
||||||
try {
|
node(POD_LABEL) {
|
||||||
stage "build"
|
stage('Build with Kaniko') {
|
||||||
def app = docker.build "library/x86_64/alpine/sonarr"
|
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-sonarr.git', credentialsId: 'jenkins-to-git'
|
||||||
|
container('kaniko') {
|
||||||
stage "publish"
|
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/sonarr:2.0.0.5344 --destination=harbor.ervine.dev/library/x86_64/alpine/sonarr:2'
|
||||||
app.push("v2.0.0.5344")
|
}
|
||||||
app.push("v2")
|
|
||||||
|
|
||||||
stage('Deploy on K8s'){
|
|
||||||
sh "/usr/local/bin/kubectl -n media delete po sonarr-0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
start.sh
Normal file → Executable file
2
start.sh
Normal file → Executable file
@ -2,5 +2,7 @@
|
|||||||
##
|
##
|
||||||
## Script to start the sonarr server
|
## Script to start the sonarr server
|
||||||
##
|
##
|
||||||
|
addgroup -g $GID $USER
|
||||||
|
adduser -D -u $UID -G $USER -H $USER
|
||||||
until [ -f "/config/nzbdrone.db" ]; do sleep 1; done
|
until [ -f "/config/nzbdrone.db" ]; do sleep 1; done
|
||||||
/usr/bin/mono --debug /NzbDrone/NzbDrone.exe --nobrowser --data=/config
|
/usr/bin/mono --debug /NzbDrone/NzbDrone.exe --nobrowser --data=/config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user