pipeline {
agent any
// If using the .NET SDK plugin, wrap steps in this block
/*
tools {
dotnetsdk 'dotnet-8'
}
*/
stages {
stage('Checkout') {
steps {
git branch: 'main',
url:'https://github.com/congduan2811/DemoJenkins.git'
}
}
stage('Restore') {
steps {
sh 'dotnet restore' // Use 'bat' for Windows
}
}
stage('Build') {
steps {
sh 'dotnet build --configuration Release'
}
}
stage('Test') {
steps {
sh 'dotnet test'
}
}
stage('Publish') {
steps {
sh 'dotnet publish -c Release -o ./publish'
}
}
}
}
steps {
git branch: ‘main_mysql’,
credentialsId: ‘c21fffbf-afb8-4963-ae02-71b270bb4f59′,
url:’https://github.com/congduan2811/GiamKichSan.git’
}