Deploying to AWS EC2 instance: syntax issue using https://github.com/techpivot/aws-code-deploy


#1

Good evening guys,

I actually have a problem that I think is stupid but I can’t figure out the reason.

I am using the following script https://github.com/techpivot/aws-code-deploy to deploy code to AWS EC2 instance.

On CircleCI 2.0 config file, I run the following command:

sh /var/www/html/aws-code-deploy.sh

But I get the following output on CircleCI:

#!/bin/bash -eo pipefail
sh /var/www/html/aws-code-deploy.sh

/var/www/html/aws-code-deploy.sh: 106: /var/www/html/aws-code-deploy.sh: Syntax error: “(” unexpected (expecting “}”)
Exited with code 2

Any idea what is happening there? Please let me know if you need more information.

Thanks a lot!


#2

When posting here, would you use Markdown, please? You can format your console IO like so:

sh /var/www/html/aws-code-deploy.sh

And the same for your logs. There’s an edit button in the toolbar just below your post. If you can get that done, I’ll take a look at your error.


#3

Try executing with bash /var/www/html/aws-code-deploy.sh

or

. ./var/www/html/aws-code-deploy.sh

instead of sh.