Switched to node builder
This commit is contained in:
parent
b3e31e335f
commit
b566d625c6
22
Dockerfile
22
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Base on latest (edge) alpine image
|
# Base on latest (edge) alpine image
|
||||||
FROM opensuse/leap:15.1
|
FROM opensuse/leap:15.2
|
||||||
|
|
||||||
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
||||||
|
|
||||||
@ -12,17 +12,17 @@ ENV LANG='en_US.UTF-8' \
|
|||||||
PM_UID='1003' \
|
PM_UID='1003' \
|
||||||
PM_GID='1003'
|
PM_GID='1003'
|
||||||
|
|
||||||
RUN zypper -n in tar wget gzip
|
RUN zypper -n in tar wget gzip && \
|
||||||
RUN groupadd -g $PM_GID $PM_GROUP
|
groupadd -g $PM_GID $PM_GROUP && \
|
||||||
RUN useradd -u $PM_UID -g $PM_GROUP -M $PM_USER
|
useradd -u $PM_UID -g $PM_GROUP -M $PM_USER && \
|
||||||
RUN mkdir /pmmp
|
mkdir /pmmp && \
|
||||||
RUN chown $PM_USER:$PM_GROUP /pmmp
|
chown $PM_USER:$PM_GROUP /pmmp && \
|
||||||
RUN wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBuild/artifact/PHP-7.3-Linux-x86_64.tar.gz > /pmmp/PHP-7.3-Linux-x86_64.tar.gz
|
wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBuild/artifact/PHP-7.3-Linux-x86_64.tar.gz > /pmmp/PHP-7.3-Linux-x86_64.tar.gz && \
|
||||||
RUN cd /pmmp && tar zxvf PHP-7.3-Linux-x86_64.tar.gz
|
cd /pmmp && tar zxvf PHP-7.3-Linux-x86_64.tar.gz
|
||||||
ADD php.ini /pmmp/bin/php7/bin/php.ini
|
ADD php.ini /pmmp/bin/php7/bin/php.ini
|
||||||
RUN rm /pmmp/PHP-7.3-Linux-x86_64.tar.gz
|
RUN rm /pmmp/PHP-7.3-Linux-x86_64.tar.gz && \
|
||||||
RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.13.0/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar
|
wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.13.0/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar && \
|
||||||
RUN chown -R $PM_USER:$PM_GROUP /pmmp
|
chown -R $PM_USER:$PM_GROUP /pmmp
|
||||||
|
|
||||||
VOLUME /plugins
|
VOLUME /plugins
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
|
|||||||
52
Jenkinsfile
vendored
52
Jenkinsfile
vendored
@ -1,23 +1,35 @@
|
|||||||
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: "3.11.3", url: "ssh://git@git.ervine.org/jonny/x86_64-suse-pocketmine", 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-suse-pocketmine.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/suse/pocketmine:3.13'
|
||||||
|
}
|
||||||
try {
|
|
||||||
stage "build"
|
|
||||||
def app = docker.build "library/x86_64/suse/pocketmine"
|
|
||||||
|
|
||||||
stage "publish"
|
|
||||||
app.push("${env.BUILD_NUMBER}")
|
|
||||||
app.push("latest")
|
|
||||||
app.push("3.12.0")
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user