Selector/.jenkins/jenkinsfile

70 lines
2.1 KiB
Plaintext
Raw Normal View History

2023-04-24 00:25:01 +01:00
pipeline {
agent any
stages {
stage('Build C#') {
2023-04-24 09:00:16 +01:00
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
}
}
2023-04-24 00:25:01 +01:00
steps {
sh "dotnet restore Selector.Core.sln"
sh "dotnet build 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'
// 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
}
}
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'
// 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
}
}
2023-04-24 00:25:01 +01:00
steps {
sh "dotnet test Selector.Core.sln"
2023-04-24 00:25:01 +01:00
}
}
stage('Deploy') {
steps {
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()
}
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
}
}
}