Search guides...
Ctrl K
Jenkins works with Jaws Deploy through PowerShell or shell steps in a declarative or scripted Jenkinsfile. Both rely on a Jenkins credential storing the API key.
Add this stage at the end of the pipeline
Store the service account ID and API key as a username/password credential. withCredentials exposes them as the environment variables the SDK reads and masks them in console output.
stage('Create release') {
steps {
withCredentials([usernamePassword(credentialsId: 'jaws-deploy-service-account',
usernameVariable: 'JAWS_API_LOGIN',
passwordVariable: 'JAWS_API_PASSWORD')]) {
pwsh '''
Import-Module ./JawsDeploySdk.psm1 # github.com/JawsDeploy/powershell-sdk
New-JawsRelease `
-projectId "<project id>" `
-version "1.0.$env:BUILD_NUMBER" `
-packageVersions @{ "Checkout.Web" = "1.0.$env:BUILD_NUMBER" }
'''
}
}
}
Without PowerShell
If the Jenkins agents are Linux without PowerShell installed, call the REST API directly with curl from an sh step. The behaviour is identical.