Build (And Publish) Docker Image
This commit is contained in:
parent
747d2032e6
commit
6d79beeeb6
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM debian:bullseye
|
||||
|
||||
# Copy DEB
|
||||
ADD ./out/minecraft-pi-reborn-server_*~bullseye_amd64.deb /root
|
||||
|
||||
# Install
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install -y tini && \
|
||||
(dpkg -i /root/*.deb || :) && \
|
||||
apt-get --fix-broken install -y && \
|
||||
rm -f /root/*.deb && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Setup Working Directory
|
||||
RUN mkdir /data
|
||||
WORKDIR /data
|
||||
|
||||
# Setup Entrypoint
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
CMD ["minecraft-pi-reborn-server"]
|
23
Jenkinsfile
vendored
23
Jenkinsfile
vendored
@ -1,12 +1,15 @@
|
||||
pipeline {
|
||||
agent none
|
||||
stages {
|
||||
stage('Build (Debian Bullseye)') {
|
||||
stage('Debian Bullseye') {
|
||||
agent {
|
||||
docker {
|
||||
image 'debian:bullseye'
|
||||
args '-v /var/run/docker.sock:/var/run/docker.sock'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './scripts/ci/run.sh'
|
||||
}
|
||||
@ -16,12 +19,26 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build (Debian Buster)') {
|
||||
stage('Publish') {
|
||||
steps {
|
||||
sh 'apt-get update && apt-get install -y docker.io'
|
||||
sh 'docker build --no-cache --tag thebrokenrail/minecraft-pi-reborn-server .'
|
||||
withCredentials([usernamePassword(credentialsId: 'docker_hub_login', usernameVariable: 'DOCKER_HUB_USERNAME', passwordVariable: 'DOCKER_HUB_PASSWORD')]) {
|
||||
sh 'docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"'
|
||||
}
|
||||
sh 'docker push thebrokenrail/minecraft-pi-reborn-server'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Debian Buster') {
|
||||
agent {
|
||||
docker {
|
||||
image 'debian:buster'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './scripts/ci/run.sh'
|
||||
}
|
||||
@ -32,4 +49,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user