Selector/.jenkins/jenkinsfile

69 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-04-24 00:25:01 +01:00
pipeline {
agent any
2023-04-29 15:40:05 +01:00
// environment {
// DOTNET_CLI_HOME = "/tmp/DOTNET_CLI_HOME"
// }
2023-04-29 00:01:39 +01:00
2023-04-24 00:25:01 +01:00
stages {
stage('Build C#') {
2023-04-29 15:40:05 +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:40:05 +01:00
// dotnetRestore project: "Selector.Core.sln", packages: './packages'
// sh 'dotnet build --packages ./packages Selector.Core.sln'
dotnetRestore project: "Selector.Core.sln"
dotnetBuild project: 'Selector.Core.sln'
2023-04-24 00:25:01 +01:00
}
}
stage('Build Javascript') {
2023-04-29 15:40:05 +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-29 15:40:05 +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') {
2023-05-14 12:22:54 +01:00
when { branch 'master' }
2023-04-24 00:25:01 +01:00
steps {
2023-04-24 09:16:28 +01:00
script {
2023-05-14 19:07:19 +01:00
docker.withRegistry('https://registry.sarsoo.xyz', 'git-registry-creds') {
2023-04-24 09:16:28 +01:00
docker.build("sarsoo/selector-cli:latest",
"-f Dockerfile.CLI .").push()
2023-04-24 09:16:28 +01:00
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
}
}
}