From e472e95b72dd64e1ae7d4821b369c0700ce4590d Mon Sep 17 00:00:00 2001 From: Mpho Majenge Date: Sat, 25 May 2024 14:03:23 +0200 Subject: [PATCH] add jenkinsfile to build for arm arch --- Jenkinsfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..195acb09 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,37 @@ +pipeline { + agent any + environment { + GITHUB_TOKEN = credentials('github') + IMAGE_NAME = 'ghcr.io/finkash-pty/frappe_docker' + RELEASE_VERSION = readFile('version').trim() + IMAGE_REPO = "${IMAGE_NAME}:${RELEASE_VERSION}" + PLATFORM = 'linux/amd64,linux/arm64' + } + stages { + stage('Login to image Repository') { + steps { + sh 'echo $GITHUB_TOKEN_PSW | docker login ghcr.io -u GITHUB_TOKEN_USR --password-stdin' + } + } + stage('Prepare Builder'){ + steps{ + script{ + sh 'export DOCKER_CLI_EXPERIMENTAL=enabled' + sh 'docker buildx use multiplatformbuilder' + } + } + } + stage('Build Image') { + steps { + script { + sh "docker buildx build --platform $PLATFORM --cache-from type=local,src=$IMAGE_REPO --cache-to type=local,dest=/tmp/.buildx-cache --push --tag $IMAGE_REPO ." + } + } + } + } + post { + always { + cleanWs() + } + } +} \ No newline at end of file