pipeline { agent any environment { DOTNET_CLI_HOME = "/tmp/DOTNET_CLI_HOME" } 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 "Selector.Core.sln" dotnetBuild "Selector.Core.sln" } } stage('Build Javascript') { agent { docker { image 'node:16' reuseNode true } } steps { dir ('Selector.Web') { sh "npm ci" sh "npm run build --if-present" } } } stage('Test') { agent { docker { image 'mcr.microsoft.com/dotnet/sdk:7.0' reuseNode true } } steps { dotnetTest "Selector.Core.sln" } } stage('Deploy') { steps { script { docker.withRegistry('https://git.sarsoo.xyz', 'git-registry-creds') { docker.build("sarsoo/selector-cli:latest", "-f Dockerfile.CLI .").push() docker.build("sarsoo/selector-web:latest", "-f Dockerfile.Web .").push() } } } } } post { always { cleanWs() } } }