From 76d83721eb423834089320a509d0bcb3df273ad1 Mon Sep 17 00:00:00 2001 From: 30hours Date: Fri, 16 Feb 2024 00:34:41 +0000 Subject: [PATCH] Add push to jenkins --- Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 039c293..80c00e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,12 @@ pipeline { agent any + environment { + GHCR_REGISTRY = "ghcr.io" + GHCR_USERNAME = credentials('30hours') + GHCR_TOKEN = credentials('ghcr-login') + } + stages { stage('Checkout') { steps { @@ -12,7 +18,7 @@ pipeline { script { echo 'Building the project' blah2 = docker.build("30hours/blah2", "--file ./Dockerfile .") - blah2_api = docker.build("30hours/blah2", "--file ./api/Dockerfile .") + blah2_api = docker.build("30hours/blah2", "--file ./api/Dockerfile ./api") } } } @@ -24,6 +30,12 @@ pipeline { stage('Push') { steps { echo 'Pushing the application' + + docker.withRegistry("${GHCR_REGISTRY}", "${GHCR_TOKEN}") { + blah2.push() + blah2_api.push() + } + } } }