From 805112acb159f3e0dded1182d18430813c4752c3 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 26 Sep 2020 19:48:47 -0400 Subject: [PATCH] Add Jenkinsfile --- Dockerfile.build | 3 +++ Jenkinsfile | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Dockerfile.build create mode 100644 Jenkinsfile diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 00000000..b5070d05 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,3 @@ +FROM ubuntu:focal + +RUN apt-get update && apt-get install -y docker.io diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..1973e699 --- /dev/null +++ b/Jenkinsfile @@ -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' + } + } + } +}