Bash/pipe redirect not working with 2.0?

elasticbeanstalk

#1

Hi all,
I am migrating my scripts to Circle CI 2.0 but I am stuck on the deployment.
My project is a Java app, which we deploy to Elastic BeanStalk (EBS). We use a docker-based approach in 2.0

Now I can install eb and all the required CLI with no problems on 2.0 as well.
When our deploy script needs to launch the eb init command - because it’s an interactive command - we need to force some return keys to skip all the interactive requests for user input.
In version 1.0 we use to do it like this

eb init APP --region REGION --profile default <<< $'2\nn\n'

however this doesn’t seem to work with CircleCI 2.0.
The script fails with a

./eb-deploy.sh: 4: ./eb-deploy.sh: Syntax error: redirection unexpected
Exited with code 2

yes 1N | eb init APP --region REGION --profile default

I get a failure on the command

Exited with code 141

Anyone has experienced this or a similar issue? Any ideas on how I could solve this?

Thank you in advance!


#2

I wonder if your shell has changed. Were you using Bash before? The shell you are now using depends on the Docker base image you’re using, but if it’s Alpine-based, it might be the ksh default.

You may still be able to get redirects to work, but you can always install expect if you get stuck.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.