initial commit

This commit is contained in:
Hyatt 2019-10-24 14:15:51 -05:00
commit 525109e15d
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

74
build-minecraft.jenkins Normal file
View File

@ -0,0 +1,74 @@
def dockerFile = """
FROM alpine:latest
MAINTAINER The_Spider <spider@smoothnet.org>
RUN \
apk add --no-cache openjdk11 curl && \
addgroup -S -g 1000 minecraft && \
adduser -S minecraft -G minecraft -h /minecraft -u 1000
USER minecraft
WORKDIR /minecraft
RUN \
curl -L https://papermc.io/api/v1/paper/1.14.4/latest/download -o /minecraft/paper-mc.jar && \
mkdir /minecraft/data && \
mkdir /minecraft/html && \
cd /minecraft/data && \
java -jar ../paper-mc.jar; exit 0
CMD cd data; java -Xms1g -Xmx20g -jar ../paper-mc.jar
"""
podTemplate(
containers: [
containerTemplate(
name: "docker",
image: "docker:19.03",
command: "sleep",
args: "99d",
envVars: [
envVar(
key: "DOCKER_HOST",
value: "tcp://localhost:2375"
)
]
),
containerTemplate(
name: "docker-daemon",
image: "docker:19.03-dind",
privileged: true,
envVars: [
envVar(
key: "DOCKER_TLS_CERTDIR",
value: ""
)
]
)
]
) {
node(POD_LABEL) {
container("docker") {
stage("Test DinD Daemon") {
sh """
docker version
"""
}
stage("Write Dockerfile"){
writeFile(file: "Dockerfile", text: dockerFile)
}
stage("Build Container"){
sh """
docker build --tag registry.test-chamber-13.lan:5000/minecraft:latest ./
"""
}
stage("Push Container"){
sh """
docker push registry.test-chamber-13.lan:5000/minecraft:latest
"""
}
}
}
}