This commit is contained in:
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -4,6 +4,7 @@ pipeline {
|
|||||||
|
|
||||||
environment {
|
environment {
|
||||||
REGISTRY_CREDENTIALS = credentials('registry-credentials-id')
|
REGISTRY_CREDENTIALS = credentials('registry-credentials-id')
|
||||||
|
PORTAINER_CREDENTIALS = credentials('portainer-credentials')
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -39,7 +40,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def json = """
|
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 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())
|
def jwtObject = new groovy.json.JsonSlurper().parseText(jwtResponse.getContent())
|
||||||
|
|||||||
Reference in New Issue
Block a user