Add Jenkinsfile
This commit is contained in:
parent
61f7d99390
commit
805112acb1
3
Dockerfile.build
Normal file
3
Dockerfile.build
Normal file
@ -0,0 +1,3 @@
|
||||
FROM ubuntu:focal
|
||||
|
||||
RUN apt-get update && apt-get install -y docker.io
|
28
Jenkinsfile
vendored
Normal file
28
Jenkinsfile
vendored
Normal 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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user