Skip to content

Instantly share code, notes, and snippets.

@rohancme
Last active November 3, 2017 02:06
Show Gist options
  • Save rohancme/d940a7425578c64524332c25096a5c46 to your computer and use it in GitHub Desktop.
Save rohancme/d940a7425578c64524332c25096a5c46 to your computer and use it in GitHub Desktop.
A simple Windows Jenkinsfile for the Kubernetes plugin
podTemplate(label: 'windows-vs2017',
containers: [
containerTemplate(name: 'jnlp', image: '{{REPLACE-WITH-YOUR-CUSTOM-IMAGE}}',
envVars:[
containerEnvVar(key: 'HOME', value:'C:\\users\\containeradministrator'),
containerEnvVar(key: 'JENKINS_HOME', value: 'G:\\')
],
workingDir:'C:\\Jenkins\\')
],
nodeSelector: 'beta.kubernetes.io/os=windows') {
node ('windows-vs2017') {
bat 'powershell.exe mkdir G:\\repo'
dir('G:\\repo\\'){
git branch: "master", credentialsId: "jenkins-windows-test", url: 'git@github.com:AzureCATE2E/JenkinsTestWindows.git'
stage ('Build'){
bat 'powershell.exe nuget restore'
bat 'powershell.exe msbuild'
bat 'powershell.exe python3 ../zip_and_upload.py -p . -o myzip'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment