snippetspringMinor
How do I write a buildspec.yml file?
Viewed 0 times
filehowbuildspecwriteyml
Problem
I have Java Spring web service project on EC2
I tried writing a
I am not able to figure it out... why does it fail for both
I tried writing a
buildspec.yml for it. However the AWS CodeBuild service is not giving successful results. In the install phase itself, it tells apt-get and yum command not found. The problem is that both yum and apt-get are not being detected. However the exemplary file in the docs is using apt-get to in the install phase. How can I make it work?I am not able to figure it out... why does it fail for both
yum and apt-get?Solution
Few ideas to help you
-
When you define a "CodeBuild" project, you can specify which base image it will use to execute your commands. The one you are using is not Ubuntu yet you are trying
-
Provide us with a better log stream.
Exporting Logs from CloudWatch
I found that the easiest way is to export logs through command-line:
Run substituting your log-group-name and -log-stream-name:
This should give you the output, which you can include in the question.
-
When you define a "CodeBuild" project, you can specify which base image it will use to execute your commands. The one you are using is not Ubuntu yet you are trying
apt-get. Try a different base image.-
Provide us with a better log stream.
Exporting Logs from CloudWatch
I found that the easiest way is to export logs through command-line:
- click on 'View Logs' link, to find out your Log Group and Log Stream
- install "awscli" and "jq"
Run substituting your log-group-name and -log-stream-name:
aws logs get-log-events --log-group-name /aws/codebuild/Dumper \
--log-stream-name 0bd74b8c-74b9-4f9b-b275-167b45901aa3 | \
jq '.events[].message' -r | grep -v '^
This should give you the output, which you can include in the question.This should give you the output, which you can include in the question.
Code Snippets
aws logs get-log-events --log-group-name /aws/codebuild/Dumper \
--log-stream-name 0bd74b8c-74b9-4f9b-b275-167b45901aa3 | \
jq '.events[].message' -r | grep -v '^$'Context
StackExchange DevOps Q#1336, answer score: 7
Revisions (0)
No revisions yet.