Add Jenkinsfile

This commit is contained in:
TheBrokenRail 2020-09-26 19:48:47 -04:00
parent 61f7d99390
commit 805112acb1
2 changed files with 31 additions and 0 deletions

3
Dockerfile.build Normal file
View File

@ -0,0 +1,3 @@
FROM ubuntu:focal
RUN apt-get update && apt-get install -y docker.io

28
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,28 @@
pipeline {
agent {
dockerfile {
filename 'Dockerfile.build'
args '-v /var/run/docker.sock:/var/run/docker.sock'
}
}
stages {
stage('Install QEMU') {
steps {
sh 'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes'
}
}
stage('Build') {
steps {
sh './build.sh'
}
}
stage('Publish') {
steps {
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'
}
}
}
}