R
R
Roqvie2020-09-25 20:04:23
Amazon Web Services
Roqvie, 2020-09-25 20:04:23

Where are sh scripts run from in BeforeInstall and AfterInstall in appspec.yml?

There is a repository on github. From there, using AWS CodeDeploy Pipelines, the code is deployed to an EC2 machine. I wrote the following in appspec.yml:

version: 0.0
os: linux
files:
  - source: /
    destination: /home/ec2-user/discord/
hooks:
  BeforeInstall:
    - location: stop.sh
      timeout: 60
      runas: user
  AfterInstall:
    - location: start.sh
      timeout: 60
      runas: user


start.sh and stop.sh are located directly in the repository, not in separate folders. When trying to deploy, BeforeInstall gives an error like "file not found"
LifecycleEvent - BeforeInstall
Script - stop.sh
[stderr]bash: /opt/codedeploy-agent/deployment-root/1f6e86fa-af22-4586-b715-9c393c86900e/d-VUFS9W9N4/deployment-archive/stop.sh: bin/bash/: bad interpreter: No such file or directory


I tried to write the full path in the location, it did not help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question