Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM python:latest

WORKDIR /app

COPY . .

RUN pip install -r "requirements.txt"
RUN pip3 install -r "requirements.txt"

EXPOSE 8080

Expand Down
29 changes: 18 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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}"
}
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# REST API starter
#


we hope we trust we want this to work
In Money We Trust - Dan was here!


THIS IS A TEST WITH A NEW CHANGE BY BR

REST API starter

This is a Python Flask REST API, serving a simple frontend for use in LBG programs

Expand Down