I use this script to display dropdown values from AWS Ecr:

    def profile = "ecr"
    def region = "us-east-1"
    def cmd_output = "aws ecr describe-repositories --profile $profile 
--region $region --output yaml".execute()
    def awk_cmd_output = cmd_output | ['awk', '/repositoryName:/ {print 
$2}'].execute()
    def repo_names = awk_cmd_output.text.tokenize().reverse()
    return repo_names

When I run the command into linux shell I get:

    root test:~# aws ecr describe-repositories --profile ecr  --region 
us-east-1
    {
        "repositories": [
            {
                "repositoryArn": 
"arn23522033165aws:ecr:us-east-1:73522033165:repository/test",
                "registryId": "23522033165",
                "repositoryName": "test",
                "repositoryUri": 
"23522033165.dkr.ecr.us-east-1.amazonaws.com/test",
                "createdAt": "2023-09-07T22:30:50+00:00",
                "imageTagMutability": "MUTABLE",
                "imageScanningConfiguration": {
                    "scanOnPush": false
                },
                "encryptionConfiguration": {
                    "encryptionType": "AES256"
                }
            },
            {
                "repositoryArn": 
"arn:aws:ecr:us-east-1:23522033165:repository/test",
                "registryId": "23522033165",
                "repositoryName": "atlas-psp-mer-gateway",
                "repositoryUri": 
"23522033165.dkr.ecr.us-east-1.amazonaws.com/test",
                "createdAt": "2023-09-09T19:54:04+00:00",
                "imageTagMutability": "MUTABLE",
                "imageScanningConfiguration": {
                    "scanOnPush": false
                },
                "encryptionConfiguration": {
                    "encryptionType": "AES256"
                }
            },
    .....
    }

Above configuration was working file. But after changing aws credentials 
using `aws configure` the listing is not working. I added api user as IAM 
user with a group into security settings.
But still I can't list images versions from a registry.
Do you know how I can fix this issue?


Ref 
https://stackoverflow.com/questions/77074046/cannot-list-image-tags-into-jenkins-active-choices-dropdown

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5fb2885f-d566-4ca1-bf67-8e352602189bn%40googlegroups.com.

Reply via email to