Skip to content

Instantly share code, notes, and snippets.

@pingkunga
Created August 4, 2023 04:24
Show Gist options
  • Save pingkunga/837913e1e7f08138b53f3e3f3b698547 to your computer and use it in GitHub Desktop.
Save pingkunga/837913e1e7f08138b53f3e3f3b698547 to your computer and use it in GitHub Desktop.
Example JenkinsFile calls parameterized PowerShell Scripts
pipeline {
agent {
label {
label 'jenkins-dotnet'
}
}
environment {
BASE_PATH = pwd();
}
options {
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
}
stages {
stage('GEN BUILD REQUEST') {
steps {
powershell(returnStdout: true, script: '''.\\WIN_DOTNET_BUILD\\NOTIFY\\BUILD\\GEN_BUILDREQUEST.ps1 $env:NETNOTIFYAPI $env:REDMINEUSERAPIKEY''')
}
}
}
post {
cleanup {
cleanWs();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment