My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Rahul wath

4 likes

·

77 reads

5 comments

Malhar Kauthale
Malhar Kauthale
Jul 22, 2024

Great tutorial but, where is the appspec.yaml file?

1
·
·2 replies
Rahul wath
Rahul wath
Author
·Jul 25, 2024

If you need an appspec.yml file in addition to the buildspec.yml file.

buildspec.yml defines the build process, while appspec.yml defines the deployment process.

appspec.yml is used by CodeDeploy to:

  1. Identify the files to deploy
  2. Specify the deployment lifecycle hooks (e.g., BeforeInstall, AfterInstall)
  3. Define the deployment settings (e.g., file permissions, directory structure)

Here's an example appspec.yml file:

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html
hooks:
  BeforeInstall:
    - location: scripts/before_install.sh
      timeout: 300
  AfterInstall:
    - location: scripts/after_install.sh
      timeout: 300

This file specifies:

  • The files to deploy (in this case, the entire repository)
  • The deployment destination (/var/www/html)
  • Two lifecycle hooks: BeforeInstall and AfterInstall, which run scripts before and after installation, respectively.

Make sure to create an appspec.yml file in the root of your repository and commit it to CodeCommit. CodeDeploy will use this file to deploy your application to the EC2 instance(s).

·
Malhar Kauthale
Malhar Kauthale
Jul 27, 2024

Thank you for the information I'm able to build the code successfully but when I try to deploy it I'm getting this error : Deploy agent was not able to receive the lifecycle event check the code deploy agent logs on your host and make sure agent is running and can connect to the code deploy server After this is i checked my code-deploy agent was running and i also restarted it and also given the necessary permissions but still facing the same issue can you suggest some solution

·
Rahul Raut
Rahul Raut
Aug 17, 2023

Nice tutorial but seems like your Reference Code repo is empty

·
·1 reply
Rahul wath
Rahul wath
Author
·Aug 17, 2023

Added simple html code file in git repo.

·