70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
pipeline {
|
|
agent any
|
|
|
|
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 {
|
|
sh "dotnet restore Selector.Core.sln"
|
|
sh "dotnet build Selector.Core.sln"
|
|
}
|
|
}
|
|
|
|
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"
|
|
sh "npm run build --if-present"
|
|
}
|
|
}
|
|
}
|
|
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 {
|
|
sh "dotnet test Selector.Core.sln"
|
|
}
|
|
}
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
cleanWs()
|
|
}
|
|
}
|
|
} |