bashcircleci

CircleCI permission denied running bash script


I have a circle.yml file like so:

dependencies:
  override:
    - meteor || curl https://install.meteor.com | /bin/sh

deployment:
  production:
    branch: "master"
    commands:
      - ./deploy.sh

When I push to Github, I get the error:

/home/ubuntu/myproject/deploy.sh returned exit code 126

bash: line 1: /home/ubuntu/myproject/deploy.sh: Permission denied Action failed: /home/ubuntu/myproject/deploy.sh

When I run the commands that live inside deploy.sh outside of the file (under commands) everything runs fine.

Everything in the circle.yml file seems to be in line with the examples in the CircleCI docs.. What am I doing wrong?


Solution

  • Several possible problems:

    1. deploy.sh might not be marked as executable (chmod +x deploy.sh would fix this)
    2. The first line of deploy.sh might not be a runnable shell...

    If the first doesn't work, can we please see the contents of deploy.sh?