From 5fc7c93217d9e1b1dbd2437e3c8b5a261ce5459a Mon Sep 17 00:00:00 2001 From: Wecancode1 Date: Fri, 12 Jul 2024 11:35:33 +0100 Subject: [PATCH 1/8] first commit and onl --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a5b021c..a76834ac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# REST API starter +# + + +we hope we trust we want this to work + + + + REST API starter This is a Python Flask REST API, serving a simple frontend for use in LBG programs From eef7a4c730c4e0e707322401347c472a1b31bb5a Mon Sep 17 00:00:00 2001 From: Dan-308 Date: Fri, 12 Jul 2024 11:43:47 +0100 Subject: [PATCH 2/8] First test --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a76834ac..141d6159 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ we hope we trust we want this to work +In Money We Trust From 56a8597030e62e83bbb5ec9088930a01c98e7a25 Mon Sep 17 00:00:00 2001 From: Dan-308 Date: Fri, 12 Jul 2024 12:01:43 +0100 Subject: [PATCH 3/8] Editted Read.me --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 141d6159..f15aba33 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ we hope we trust we want this to work -In Money We Trust +In Money We Trust - Dan was here From 829518bcd8f0082d778a8b5539ad73e6423e90d9 Mon Sep 17 00:00:00 2001 From: Dan-308 Date: Fri, 12 Jul 2024 12:08:10 +0100 Subject: [PATCH 4/8] Added to readme.txt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f15aba33..c6b133c4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ we hope we trust we want this to work -In Money We Trust - Dan was here +In Money We Trust - Dan was here! From 8b135dc59a0319e93eb2631a2cef29598bcebf8b Mon Sep 17 00:00:00 2001 From: BR-QA-training Date: Fri, 12 Jul 2024 12:13:21 +0100 Subject: [PATCH 5/8] first commit by br --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 141d6159..b1a3925a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ we hope we trust we want this to work In Money We Trust +THIS IS A TEST WITH A NEW CHANGE BY BR REST API starter From 93ba193cd7e6b3ed92d8f0dae26001b08e5b2a52 Mon Sep 17 00:00:00 2001 From: BR-QA-training Date: Fri, 19 Jul 2024 09:59:10 +0100 Subject: [PATCH 6/8] Dockerfile updated to remove workdir instruction --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 016bb2fb..2d369a4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM python:latest -WORKDIR /app - COPY . . RUN pip install -r "requirements.txt" From a37df6fec8a2bd8127296f8b9abf54f6030a5360 Mon Sep 17 00:00:00 2001 From: Wecancode1 <59051683+Wecancode1@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:24:04 +0100 Subject: [PATCH 7/8] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2d369a4c..05058760 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:latest COPY . . -RUN pip install -r "requirements.txt" +RUN pip3 install -r "requirements.txt" EXPOSE 8080 From e74eccaf0383f4262e99d2bef71e9310f572c596 Mon Sep 17 00:00:00 2001 From: Wecancode1 <59051683+Wecancode1@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:26:56 +0100 Subject: [PATCH 8/8] Update Jenkinsfile --- Jenkinsfile | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e6673ef..b8094068 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,25 @@ pipeline { agent any + environment { + GCR_CREDENTIALS_ID = 'jenkins-secret' // The ID you provided in Jenkins credentials + IMAGE_NAME = 't3-image' + GCR_URL = 'europe-west1-docker.pkg.dev/lbg-mea-20/repo-t3' + } stages { - stage('Build') { - steps { - sh ''' - - ''' - } - } - stage('Deploy') { + stage('Build and Push to GCR') { steps { - sh ''' - - ''' + script { + // Authenticate with Google Cloud + withCredentials([file(credentialsId: GCR_CREDENTIALS_ID, variable: 'GOOGLE_APPLICATION_CREDENTIALS')]) { + sh 'gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS' + } + // Configure Docker to use gcloud as a credential helper + sh 'gcloud auth configure-docker --quiet' + // Build the Docker image + sh "docker build -t ${GCR_URL}/${IMAGE_NAME}:${BUILD_NUMBER} ." + // Push the Docker image to GCR + sh "docker push ${GCR_URL}/${IMAGE_NAME}:${BUILD_NUMBER}" + } } } }