Skip to content

Instantly share code, notes, and snippets.

@abn
Created November 28, 2017 23:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abn/9602a6e6fb176d40901936cd1b51f7df to your computer and use it in GitHub Desktop.
Save abn/9602a6e6fb176d40901936cd1b51f7df to your computer and use it in GitHub Desktop.
Jenkinsfile: OpenShift podTemplate example
// this currently is restricted on OpenShift Online, however is possible on OSD/OCP clusters
// we create a dotnet builder pod using the provided jenkins slave image for executing dotnet commands in
podTemplate(
label: 'dotnet-build-pod', cloud: 'openshift',
containers: [
containerTemplate(
name: 'dotnet-build-pod', image: 'registry.access.redhat.com/dotnet/dotnet-20-jenkins-slave-rhel7:latest'
)
]) {
node('dotnet-build-pod-x') {
stage('Display .NET Version') {
sh """
dotnet --version
"""
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment