From 25b5de7dc16944a75d619983b7603aaa1b2d45ff Mon Sep 17 00:00:00 2001 From: Zheyuan Wu <60459821+Trance-0@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:07:34 -0600 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b982250..984492c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,30 @@ pipeline { - agent any + + environment { + registry = "trance0/notenextra" + version = "1.0" + } + + agent { dockerfile true } stages { - stage('Build') { - steps { - echo 'Building..' - } - } stage('Test') { steps { echo 'Testing..' + sh 'npm install' + sh 'npm run build' + } + } + stage('Build') { + steps { + echo "Building docker image ${registry}:${version}.${env.BUILD_ID}" + customImage = docker.build("${registry}:${version}.${env.BUILD_ID}") } } stage('Deploy') { steps { - echo 'Deploying....' + echo "Deploying docker image ${registry}:${version}.${env.BUILD_ID}" + customImage.push() } } }