def label = "node-${UUID.randomUUID().toString()}" podTemplate(label: label, inheritFrom: 'base', , containers: [ containerTemplate(name: 'base', image: 'taylorchristieyardstick/build-base:node') ]) { node(label) { stage('Checkout Project') { container('base') { checkout scm } } stage('Install Dependencies') { container('base') { sh "npm ci" sh "npm install -g typescript" } } stage('Run unit tests') { container('base') { sh "npm test" } } stage('Build the Project') { container('base') { sh "tsc" } } stage('Login to Dockerhub') { withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) { container('base') { sh "docker login --username ${USER} --password ${PASS}" } } } stage('Build the Docker Image') { container('base') { sh "make build" } } stage('Push the Docker Image') { container('base') { sh "make push" } } } }