This commit is contained in:
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -4,6 +4,7 @@ pipeline {
|
||||
|
||||
environment {
|
||||
REGISTRY_CREDENTIALS = credentials('registry-credentials-id')
|
||||
PORTAINER_CREDENTIALS = credentials('portainer-credentials')
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -39,7 +40,7 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
def json = """
|
||||
{"username": "test", "password": "test"}
|
||||
{"username": "${PORTAINER_CREDENTIALS_USR}", "password": "${PORTAINER_CREDENTIALS_PSW}"}
|
||||
"""
|
||||
def jwtResponse = httpRequest acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_JSON', validResponseCodes: '200', httpMode: 'POST', ignoreSslErrors: true, consoleLogResponseBody: true, requestBody: json, url: "https://portainer.<yourdomain>.com/api/auth"
|
||||
def jwtObject = new groovy.json.JsonSlurper().parseText(jwtResponse.getContent())
|
||||
|
||||
Reference in New Issue
Block a user