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

+2 votes
Hi I have two java applications I want build these two java applications using code build could you plz help on this.
Dec 3, 2019 in DevOps on Cloud by sri
• 250 points
2,785 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 Dec 4, 2019 by Kalgi
• 52,360 points

selected Dec 4, 2019 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

I am looking for a python code to get my Azure VM status in my email , like whether the running vms port is open to the internet. If its open to internet I should get a mail notification

Hey, @Sourav, Check this out https://www.edureka.co/community/66025/azure-vm-monitoring It deals with ...READ MORE

answered May 29, 2020 in DevOps on Cloud by Sirajul
• 59,230 points
1,392 views
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,300 points
3,620 views
+1 vote
0 answers

Getting error when I start build in aws code build .

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

Dec 3, 2019 in DevOps on Cloud by sri
• 250 points
1,100 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,220 points

edited Oct 16, 2018 by lina 32,862 views
0 votes
2 answers

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

readline function help to  read line in ...READ MORE

answered Jun 21, 2020 in Python by sahil
• 580 points
1,428 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,300 points
1,040 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,260 points
5,109 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, 2019 in DevOps on Cloud by Kalgi
• 52,360 points
832 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
• 52,360 points
668 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP