Skip to content

Commit

Permalink
Merge pull request #26 from reinhard-brandstaedter/dev
Browse files Browse the repository at this point in the history
X-Platform Docker image builds
  • Loading branch information
reinhard-brandstaedter authored Sep 25, 2023
2 parents 92ace58 + 9bdb28c commit 52f3a36
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pipeline {
steps {
sh 'printenv'
dir("${env.WORKSPACE}/src"){
sh label: 'Build solarflow-statuspage', script: 'docker -H ${DOCKER_HOST} build -t ${DOCKER_REGISTRY}/solarflow-statuspage:${BRANCH_NAME} .'
sh label: 'Set up X-Builder', script: 'docker buildx rm crossbuilder && docker buildx create --name crossbuilder --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 && docker buildx ls && docker buildx use crossbuilder && docker buildx inspect --bootstrap'
sh label: 'Build solarflow-statuspage', script: 'docker -H ${DOCKER_HOST} buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t ${DOCKER_REGISTRY}/solarflow-statuspage:${BRANCH_NAME} .'
}
script {
if (env.BRANCH_NAME == 'master') {
dir("${env.WORKSPACE}/src"){
sh label: 'Build solarflow-statuspage', script: 'docker -H ${DOCKER_HOST} build -t ${DOCKER_REGISTRY}/solarflow-statuspage:${TAG} -t ${DOCKER_REGISTRY}/solarflow-statuspage:latest .'
sh label: 'Set up X-Builder', script: 'docker buildx rm crossbuilder && docker buildx create --name crossbuilder --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 && docker buildx ls && docker buildx use crossbuilder && docker buildx inspect --bootstrap'
sh label: 'Build solarflow-statuspage', script: 'docker -H ${DOCKER_HOST} buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t ${DOCKER_REGISTRY}/solarflow-statuspage:${TAG} -t ${DOCKER_REGISTRY}/solarflow-statuspage:latest .'
}
dir("${env.WORKSPACE}/imageexport") {
sh label: 'GitHub CLI login', script: 'echo ${GITHUB_AUTH_TOKEN} | gh auth login --with-token'
Expand All @@ -39,13 +41,13 @@ pipeline {
steps {
sh label: 'Docker Login', script: 'docker login -u ${DOCKERHUB_LOGIN_USR} -p ${DOCKERHUB_LOGIN_PSW}'
dir("${env.WORKSPACE}/src") {
sh label: 'Push solarflow-statuspage', script: 'docker push -q ${DOCKER_REGISTRY}/solarflow-statuspage:${BRANCH_NAME}'
sh label: 'Push solarflow-statuspage', script: 'docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -q -t ${DOCKER_REGISTRY}/solarflow-statuspage:${BRANCH_NAME} .'
}
script {
if (env.BRANCH_NAME == 'master') {
dir("${env.WORKSPACE}/src"){
sh label: 'Push solarflow-statuspage', script: 'docker push -q ${DOCKER_REGISTRY}/solarflow-statuspage:latest'
sh label: 'Push solarflow-statuspage', script: 'docker push -q ${DOCKER_REGISTRY}/solarflow-statuspage:${TAG}'
sh label: 'Push solarflow-statuspage', script: 'docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -q -t ${DOCKER_REGISTRY}/solarflow-statuspage:latest .'
sh label: 'Push solarflow-statuspage', script: 'docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -q -t ${DOCKER_REGISTRY}/solarflow-statuspage:${TAG} .'
}
}
}
Expand Down

0 comments on commit 52f3a36

Please sign in to comment.