ingenieux / awseb-deployment-plugin

Jenkins Plugin for AWS Elastic Beanstalk
Apache License 2.0
29 stars 53 forks source link

javax.security.auth.login.CredentialNotFoundException: xxx-aws-poc-xxx #95

Closed MahehsChewale closed 4 years ago

MahehsChewale commented 4 years ago

def call(config=[:]) {

if(!config.releaseNo) {
    error "[releaseNo] required with format [major].[minor].[revision]"
}

if(!config.versionNumber) {
    error "[versionNumber] build number required!"
}

if(!config.credentialsId) {
    error "[awsElasticBeanstalkDeploy] credentialsID required!"
}

if(!config.awsRegion) {
    error "[awsRegion] deploy region required!"
}

if(!config.applicationName) {
    error "[applicationName] required!"
}

if(!config.environment) {
    error "[environment] name is required!"
}

//if(!config.bucketName) {
//  error "[bucketName] S3 bucket name required!"
//}

def prefix = config.keyPrefix ?: "XXXX"

def packagePath = WORKSPACE + "\\apps\\" +  config.applicationName + ".zip"

def versionLabel = config.versionLabelFormat ?: config.releaseNo + "." + config.versionNumber

def versionDescrip = config.versionDescriptionFormat ?: config.releaseNo

def zeroDown_Time = config.zeroDowntime ?: true

def health_Check = config.checkHealth ?: true

def maxAttempt = config.maxAttempts ?: 5

step([ $class: 'AWSEBDeploymentBuilder', credentialId: config.credentialsId,
     awsRegion: config.awsRegion, applicationName: config.applicationName,
     environment: config.environment, keyPrefix: prefix, versionLabelFormat: versionLabel,
     versionDescriptionFormat: versionDescrip, zeroDowntime: zeroDown_Time,
     checkHealth: health_Check, maxAttempts: maxAttempt, rootObject: packagePath])

}

above groovy present in our Jenkins Library. I am calling that like below in pipeline script.

@Library(['XX','XX']) _ pipeline { agent any

stages { stage('Hello') { steps { awsebDeployment releaseNo: '4.11.0', versionNumber: '0001', credentialsId: 'aws-poc-user', awsRegion: 'XX-east-X', applicationName: 'XXX-deploy-poc', environment: 'XXXdeploypoc-dev' } } } } but its throwing credentials not found error even credentials is present in jenkins. Credentials are configured as username and password not with access key and access id. Does this plugin work with username and password.

MahehsChewale commented 4 years ago

withCredentials resolved my issue.