Could you plz help me creating buildspec file for build java application I am using code build .

+1 vote
Hi I have two java applications I want build these two java applications using code build could you plz help on this.
5 days ago in DevOps on Cloud by sri
• 240 points
33 views

1 answer to this question.

+1 vote
Best answer

Hello @Sri, have a look at this, might be helpful:

version: 0.2

phases:
  install:
    commands:
      - apt-get update -y
      - apt-get install -y software-properties-common
      - add-apt-repository ppa:openjdk-r/ppa
      - apt-get update -y
      - apt-get install -y openjdk-8-jdk
      - apt-get install -y maven
  pre_build:
    commands:
      - echo Logging in to Amazon ECR...
      - $(aws ecr get-login --region $AWS_DEFAULT_REGION)
  build:
    commands:
      - echo Build started on `date`
      - echo Building the Docker image...
      - mvn install
  post_build:
    commands:
      - echo Build completed on `date`
      - echo Pushing the Docker image...
answered 4 days ago by Kalgi
• 45,780 points

selected 4 days ago by sri
Hey thank you so much #kalgi
It's my pleasure:)

Let me know if you have more doubts.
Sure @ kalgi and build spec file is
 working . Thank you so much .
I am glad that it worked...

Upvote the answer if it has helped you :)

Related Questions In DevOps on Cloud

0 votes
1 answer

How can I remove a port from url for node app using nginx

If you run your node server on ...READ MORE

answered Apr 10, 2018 in DevOps on Cloud by ajs3033
• 7,280 points
624 views
+1 vote
0 answers

Getting error when I start build in aws code build .

When I start build using code build ...READ MORE

4 days ago in DevOps on Cloud by sri
• 240 points
27 views
0 votes
1 answer

How to manage Application version for VM's in Azure Autoscaling group

First of all, You have to launch ...READ MORE

answered Apr 23, 2018 in DevOps on Cloud by shubham
• 6,890 points
90 views
0 votes
1 answer

How to control development/prod/staging application settings using azure functions?

You should use a build-release system like ...READ MORE

answered May 10, 2018 in DevOps on Cloud by ajs3033
• 7,280 points
329 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,160 points

edited Oct 16, 2018 by lina 5,720 views
0 votes
1 answer

In Python, how do I read a file line-by-line into a list?

with open(fname) as f:     content = f.readlines() # you ...READ MORE

answered Oct 9, 2018 in Python by SDeb
• 13,210 points
141 views
0 votes
1 answer

When to use file vs open in Python?

File() has been removed since Python 3.0 ...READ MORE

answered Oct 30, 2018 in Python by SDeb
• 13,210 points
35 views
0 votes
1 answer

How to write to CSV line by line in python

The simple way of doing this will ...READ MORE

answered Nov 15, 2018 in Python by findingbugs
• 3,180 points
507 views
+1 vote
1 answer

python code for email notification after codedeploy is successful.

Hey @Rishi, you can create a trigger ...READ MORE

answered Oct 11 in DevOps on Cloud by Kalgi
• 45,780 points
98 views
0 votes
1 answer

Can i include custom data in a AWS cloudwatch alarm

You would have routied the alert event ...READ MORE

answered Aug 2, 2018 in DevOps on Cloud by Kalgi
• 45,780 points
64 views