blob: 29a41090482017060cefc623f8c21f6ca2688df2 [file] [log] [blame]
Francisco-Javier Ramón Salgueroa4f64f42020-09-14 16:39:02 +02001def dockerImage
2
garciadeblaseafa63f2020-08-31 16:56:09 +02003pipeline {
Francisco-Javier Ramón Salgueroa4f64f42020-09-14 16:39:02 +02004 environment {
5 imagename = "opensourcemano/api-fe"
6 registryCredential = '<credentials>' // To be updated with actual ID in the future
7 }
8 agent any
9 stages {
10 stage('Build API-FE image') {
11 steps{
12 sh "echo Building API-FE image"
13 script {
14 dockerImage = docker.build "${env.imagename}:${env.BUILD_NUMBER}"
garciadeblaseafa63f2020-08-31 16:56:09 +020015 }
Francisco-Javier Ramón Salgueroa4f64f42020-09-14 16:39:02 +020016 }
garciadeblaseafa63f2020-08-31 16:56:09 +020017 }
Francisco-Javier Ramón Salgueroa4f64f42020-09-14 16:39:02 +020018 stage('Upload to Docker registry') {
19 steps{
20 sh "echo Here it would upload the image with appropriate tags: build number, latest"
21 /*script {
22 docker.withRegistry( '', registryCredential ) {
23 dockerImage.push("${env.BUILD_NUMBER}")
24 dockerImage.push('latest')
25 }
26 }*/
27 }
28 }
29 stage('Remove unused Docker image') {
30 steps{
31 sh "docker rmi ${imagename}:${BUILD_NUMBER}"
32 // Commented until "upload" stage can be uncommented as well
33 //sh "docker rmi ${imagename}:latest"
34 }
35 }
36 }
garciadeblaseafa63f2020-08-31 16:56:09 +020037}