From c88a4347d75d7eab84026cc2e750cb9aca4d49ec Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Mon, 14 Apr 2025 18:21:24 +0200 Subject: [PATCH 1/5] Update version.txt --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index cbec0de0..f90a7b3c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.38.1 +v1.39.1 From 8c4738f12d97fe4d8d09bdd292179a0cede09c05 Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:14:16 +0200 Subject: [PATCH 2/5] Update Jenkinsfile --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 57d6bf97..dbcac16e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ pipeline { environment { NODE_VERSION = '20.17.0' + PR_NUMBER = "${env.CHANGE_ID}" // PR number comes from webhook payload } stages { @@ -32,6 +33,38 @@ pipeline { sh 'npm run build' } } + + stage('Build and Push Docker Image') { + when { + expression { return env.CHANGE_ID != null } // Only run if it's a PR + } + steps { + withCredentials([string(credentialsId: 'gh-pat', variable: 'GITHUB_PASS')]) { + + // Docker login step + sh ''' + echo "$GITHUB_PASS" | docker login ghcr.io -u "egelhaus" --password-stdin + ''' + + // Set image tag dynamically based on the PR number + sh ''' + IMAGE_TAG="ghcr.io/gitroomhq/postiz-app-pr:$PR_NUMBER" + echo "IMAGE_TAG=$IMAGE_TAG" >> image.env + ''' + + // Build Docker image + sh ''' + source image.env + docker build -f Dockerfile.dev -t $IMAGE_TAG . + ''' + + // Push Docker image to GitHub Container Registry + sh ''' + source image.env + docker push $IMAGE_TAG + ''' + } + } } post { success { From f92a24e052465980b89ca996204d7a89db47697c Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:23:29 +0200 Subject: [PATCH 3/5] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index dbcac16e..782c32d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,6 +65,7 @@ pipeline { ''' } } + } } post { success { From 6b6ce501a324040c70eadb7d73e65e75e8aba7bb Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:40:30 +0200 Subject: [PATCH 4/5] Update Jenkinsfile --- Jenkinsfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 782c32d4..52f5aed2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { environment { NODE_VERSION = '20.17.0' PR_NUMBER = "${env.CHANGE_ID}" // PR number comes from webhook payload + IMAGE_TAG="ghcr.io/gitroomhq/postiz-app-pr:${env.CHANGE_ID}" } stages { @@ -40,24 +41,15 @@ pipeline { } steps { withCredentials([string(credentialsId: 'gh-pat', variable: 'GITHUB_PASS')]) { - // Docker login step sh ''' echo "$GITHUB_PASS" | docker login ghcr.io -u "egelhaus" --password-stdin ''' - - // Set image tag dynamically based on the PR number - sh ''' - IMAGE_TAG="ghcr.io/gitroomhq/postiz-app-pr:$PR_NUMBER" - echo "IMAGE_TAG=$IMAGE_TAG" >> image.env - ''' - // Build Docker image sh ''' source image.env docker build -f Dockerfile.dev -t $IMAGE_TAG . ''' - // Push Docker image to GitHub Container Registry sh ''' source image.env From e60566f6a9e7dc7e1d2ac5a6dd330e1531a040e3 Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:46:19 +0200 Subject: [PATCH 5/5] Update Jenkinsfile --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 52f5aed2..e7a614d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,12 +47,10 @@ pipeline { ''' // Build Docker image sh ''' - source image.env docker build -f Dockerfile.dev -t $IMAGE_TAG . ''' // Push Docker image to GitHub Container Registry sh ''' - source image.env docker push $IMAGE_TAG ''' }