Mattias Petter Johansson
09/14/2023, 5:30 PMMarvin
09/14/2023, 5:31 PM|
) is used in shell scripts to pass the output of one command as the input to another. However, it seems like the shell is interpreting it as a part of the aws ecr get-login-password
command, which it isn't.
You might want to try enclosing the entire command in quotes. Here's how you could adjust your script:
yaml
- prefect.deployments.steps.run_shell_script:
id: login-for-aws-ecr
script: "aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com|199214789681.dkr.ecr.eu-north-1.amazonaws.com>"
stream_output: true
This should ensure that the shell interprets the pipe character correctly. If this doesn't work, you might be dealing with a more complex issue. But let's cross that bridge when we come to it, shall we?Mattias Petter Johansson
09/14/2023, 5:38 PMMarvin
09/14/2023, 5:39 PMyaml
- prefect.deployments.steps.run_shell_script:
id: login-for-aws-ecr
script: "/bin/bash -c 'aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com|199214789681.dkr.ecr.eu-north-1.amazonaws.com>'"
stream_output: true
This should force the command to be interpreted by a shell, which should understand the pipe character and the redirection. If this doesn't work, well, we'll just have to come up with another plan. It's not like I have anything better to do.