From 83f9d30c20935b5c3a05a0e197e36d1b71ca6eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85dne=20E=2E=20Moldes=C3=A6ter?= Date: Thu, 27 Aug 2020 22:38:36 +0200 Subject: [PATCH] Updated jenkins file --- Jenkinsfile | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 29cd8a5..02c0585 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,29 @@ pipeline { agent any stages { - stage('docker build') { - steps { - echo 'Starting docker image build' - script { - docker.withRegistry("https://pkg.northcode.no", 'docker-login') { - def image = docker.build("pkg.northcode.no/rollux") - image.push() - } + stage('build') { + agent { + docker { + image 'rust' + reuseNode true + } + } + steps { + sh 'cargo build --release' + stash includes: 'target/release/rollux', name: 'app' + } + } + stage('docker build') { + steps { + unstash 'app' + echo 'Starting docker image build' + script { + docker.withRegistry("https://pkg.northcode.no", 'docker-login') { + def image = docker.build("pkg.northcode.no/rollux") + image.push() + } + } + } } - } } - } }