2023-04-24 00:25:01 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
2023-04-29 00:01:39 +01:00
|
|
|
environment {
|
|
|
|
DOTNET_CLI_HOME = "/tmp/DOTNET_CLI_HOME"
|
|
|
|
}
|
|
|
|
|
2023-04-24 00:25:01 +01:00
|
|
|
stages {
|
|
|
|
stage('Build C#') {
|
2023-04-24 09:00:16 +01:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'mcr.microsoft.com/dotnet/sdk:7.0'
|
|
|
|
}
|
|
|
|
}
|
2023-04-24 00:25:01 +01:00
|
|
|
steps {
|
2023-04-29 15:36:04 +01:00
|
|
|
dotnetRestore project: "Selector.Core.sln", packages: './packages'
|
2023-04-29 15:34:29 +01:00
|
|
|
sh 'dotnet build --packages ./packages Selector.Core.sln'
|
2023-04-24 00:25:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build Javascript') {
|
2023-04-24 09:00:16 +01:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'node:16'
|
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
2023-04-24 00:25:01 +01:00
|
|
|
steps {
|
2023-04-24 00:33:55 +01:00
|
|
|
dir ('Selector.Web') {
|
|
|
|
sh "npm ci"
|
|
|
|
sh "npm run build --if-present"
|
|
|
|
}
|
2023-04-24 00:25:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Test') {
|
2023-04-24 09:00:16 +01:00
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'mcr.microsoft.com/dotnet/sdk:7.0'
|
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
2023-04-24 00:25:01 +01:00
|
|
|
steps {
|
2023-04-29 00:03:08 +01:00
|
|
|
dotnetTest project: "Selector.Core.sln"
|
2023-04-24 00:25:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Deploy') {
|
|
|
|
steps {
|
2023-04-24 09:16:28 +01:00
|
|
|
script {
|
|
|
|
docker.withRegistry('https://git.sarsoo.xyz', 'git-registry-creds') {
|
2023-04-24 09:15:36 +01:00
|
|
|
|
2023-04-24 09:16:28 +01:00
|
|
|
docker.build("sarsoo/selector-cli:latest",
|
|
|
|
"-f Dockerfile.CLI .").push()
|
2023-04-24 09:15:36 +01:00
|
|
|
|
2023-04-24 09:16:28 +01:00
|
|
|
docker.build("sarsoo/selector-web:latest",
|
|
|
|
"-f Dockerfile.Web .").push()
|
|
|
|
}
|
2023-04-24 09:15:36 +01:00
|
|
|
}
|
2023-04-24 00:25:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
2023-04-24 00:36:09 +01:00
|
|
|
cleanWs()
|
2023-04-24 00:25:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|