SupportChild/Jenkinsfile

70 lines
No EOL
2.5 KiB
Groovy

pipeline
{
agent any
stages
{
stage('Setup Dependencies')
{
steps
{
sh 'dotnet restore'
}
}
stage('Build')
{
parallel
{
stage('Linux')
{
steps
{
sh 'dotnet publish -r linux-x64 -c Release -p:PublishTrimmed=true --self-contained true --no-restore --output linux-x64/'
sh 'mv linux-x64/supportchild linux-x64/supportchild-sc'
sh 'dotnet publish -r linux-x64 -c Release --self-contained false --no-restore --output linux-x64/'
archiveArtifacts(artifacts: 'linux-x64/supportchild', caseSensitive: true)
archiveArtifacts(artifacts: 'linux-x64/supportchild-sc', caseSensitive: true)
}
}
stage('Windows')
{
steps
{
sh 'dotnet publish -r win-x64 -c Release -p:PublishTrimmed=true --self-contained true --no-restore --output windows-x64/'
sh 'mv windows-x64/supportchild.exe windows-x64/supportchild-sc.exe'
sh 'dotnet publish -r win-x64 -c Release --self-contained false --no-restore --output windows-x64/'
archiveArtifacts(artifacts: 'windows-x64/supportchild.exe', caseSensitive: true)
archiveArtifacts(artifacts: 'windows-x64/supportchild-sc.exe', caseSensitive: true)
}
}
stage('RHEL9')
{
agent
{
dockerfile { filename 'packaging/RHEL9.Dockerfile' }
}
environment { DOTNET_CLI_HOME = "/tmp/.dotnet" }
steps
{
sh 'rpmbuild -bb packaging/supportchild.spec --define "_topdir $PWD/.rpmbuild-el9" --define "dev_build true"'
sh 'cp .rpmbuild-el9/RPMS/x86_64/supportchild-dev-*.el9.x86_64.rpm linux-x64/'
archiveArtifacts(artifacts: 'linux-x64/supportchild-dev-*.el9.x86_64.rpm', caseSensitive: true)
}
}
stage('RHEL8')
{
agent
{
dockerfile { filename 'packaging/RHEL8.Dockerfile' }
}
environment { DOTNET_CLI_HOME = "/tmp/.dotnet" }
steps
{
sh 'rpmbuild -bb packaging/supportchild.spec --define "_topdir $PWD/.rpmbuild-el8" --define "dev_build true"'
sh 'cp .rpmbuild-el8/RPMS/x86_64/supportchild-dev-*.el8.x86_64.rpm linux-x64/'
archiveArtifacts(artifacts: 'linux-x64/supportchild-dev-*.el8.x86_64.rpm', caseSensitive: true)
}
}
}
}
}
}