From 0bd7bee2a86da16101e3327bad5c492301ba95a1 Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Mon, 24 Apr 2023 09:00:16 +0100 Subject: [PATCH] testing running from inside containers --- .jenkins/jenkinsfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.jenkins/jenkinsfile b/.jenkins/jenkinsfile index 3b611d1..d72446f 100644 --- a/.jenkins/jenkinsfile +++ b/.jenkins/jenkinsfile @@ -3,6 +3,15 @@ pipeline { stages { stage('Build C#') { + agent { + docker { + image 'mcr.microsoft.com/dotnet/sdk:7.0' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + } + } steps { dotnetRestore project: "Selector.Core.sln" dotnetBuild project: "Selector.Core.sln" @@ -10,6 +19,15 @@ pipeline { } stage('Build Javascript') { + agent { + docker { + image 'node:16' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + } + } steps { dir ('Selector.Web') { sh "npm ci" @@ -18,6 +36,15 @@ pipeline { } } stage('Test') { + agent { + docker { + image 'mcr.microsoft.com/dotnet/sdk:7.0' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + } + } steps { dotnetTest project: "Selector.Core.sln" }