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
565 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
• 51,950 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 in DevOps on Cloud by Sirajul
• 57,890 points
107 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,280 points
1,377 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
193 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,910 points
147 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 15,673 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 in Python by sahil
• 540 points
271 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,250 points
76 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
2,376 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
• 51,950 points
170 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
• 51,950 points
175 views