9

I'm working on to implement pipeline on AWS, but getting error YAML_FILE_ERROR: YAML file does not exist, I don't know why. I'm using github repo for mean stack project, entry file is docker-compose. Yml.

thanks

Abhishek
  • 1,469
  • 1
  • 12
  • 20
  • For CodeBuild you need a `buildspec.yml`... – jogold May 08 '19 at 10:55
  • @jogold yes i know that but i can't understand how to add `buildspec.yml ` where. because `docker-compose.yml` file is for same work – Abhishek May 08 '19 at 11:22
  • At the root of your repo. – jogold May 08 '19 at 11:24
  • @jogold can i rename of my `docker-compose.yml` to `buildspec.yml`? on my github repository. – Abhishek May 08 '19 at 11:26
  • No, it's a different type of file, see https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html – jogold May 08 '19 at 11:30
  • @jogold thanks for helping me. after adding `buildspec.yml` getting some error i thing i made mistake on `buildspec.yml` file cam help to sort out this problem `MEAN STACK` project contains two folder `API`, `FRONT END` and `buildspec.yml`. – Abhishek May 09 '19 at 04:59
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/193085/discussion-between-abhishek-and-jogold). – Abhishek May 09 '19 at 09:16
  • @jogold `buildspec.yml` file problem is solved in deploy failed with different different error. i'm to try to figure out but but not help me to short out this problem. – Abhishek May 10 '19 at 09:29
  • Please update your question or post another question with your detailed problem and include your `buildspec.yml` file. – jogold May 10 '19 at 10:04

3 Answers3

13

AWS CodeBuild expects the buildspec.yml file to be at the top level. A common mistake people make is to zip the code folder, which does contain buildspec.ymlat the top level, but when this zip file is extracted, it creates the code folder and puts the buildspec.yml inside that (the way it was locally), meaning buildspec.yml is now NOT at the top level.

The solution is: instead of zipping the code folder, go inside the code folder, select all the files, and then do a zip.

This is what Amazon says here:

Important

Do not include the (root directory name) directory, only the directories and files in the (root directory name) directory.

It's a quirky little thing that trips many people (including me).

Pravin Singh
  • 141
  • 4
1

Now Amazon has given an option to change the location of the buildspec.yml file or even change the yml file name.

In Developer Tool -> Build -> "Build Project" -> "Your project Name" -> "Build details" -> Buildspec -> "Buildspec name - optional"

This is the instruction by AWS for that setting:

If your buildspec file uses a different name or location, enter its path from the source root here (for example, buildspec-two.yml or configuration/buildspec.yml).

0

There is possible you are missing buildspec.yaml or buildspec.yml file, other possibility is that you might wrong name of this file.

muhammad shahan
  • 157
  • 1
  • 12