buildkite-plugins / monorepo-diff-buildkite-plugin

Run separate pipelines for each folder in your monorepo
MIT License
20 stars 6 forks source link

ECR Authentication Issues #21

Open mwwolters opened 2 months ago

mwwolters commented 2 months ago

I am trying to use this plugin in conjunction with the ecr plugin, but when I do I get a no basic auth credentials error when trying to push the container. The ECR login succeeded before the monorepo step ran:

[2024-07-10T22:47:38Z] ^^^ Authenticating with AWS ECR in <REDACTED> for <REDACTED> :ecr: :docker:
| [2024-07-10T22:47:39Z] WARNING! Your password will be stored unencrypted in <REDACTED>
| [2024-07-10T22:47:39Z] Configure a credential helper to remove this warning. See
| [2024-07-10T22:47:39Z] https://docs.docker.com/engine/reference/commandline/login/#credentials-store
| [2024-07-10T22:47:39Z]
| [2024-07-10T22:47:39Z] Login Succeeded

but it was unable to push. If I remove the monorepo plugin, then the push works as expected.

Working pipeline:

steps:
  - label: "Build"
    key: "key"
    commands:
      - cd ops
      - docker build . -f . -t $ECR_URI
      - docker push $ECR_URI
    plugins:
      - ecr#89b335a:
          login: true
          region: ${REGION}
          account-ids:
            - ${ECR_ACCOUNT}

Not working:

steps:
  - label: "Build"
    key: "key"
    plugins:
      - ecr#89b335a:
          login: true
          region: ${REGION}
          account-ids:
            - ${ECR_ACCOUNT}
      - monorepo-diff#v1.0.1:
          watch:
            - path: .
              config:
                commands:
                  - cd ops
                  - docker build . -f . -t $ECR_URI
                  - docker push $ECR_URI