Application properties

0

Hello, I have a question regarding application properties.

Successfully set up a CodePipeline that pulls content of a repository from github, builds the java app with CodeBuild and deploys it on Elastic Beanstalk.

Would like to modify the build and include an extra step to replace the application.properties file before creating the jar.

Would like to specify this step in the buildspec.yml that currently looks like this:

pre_build: commands: - echo "Copying application.properties to CodeBuild..." - cp -f /root/xyz-api/config/application.properties ./src/main/resources/ build: commands: - mvn test post_build: commands: - mvn package Unfortunately the pre_build phase fails. Where can we store the application.properties file to be accessible by CodeBuild (so the pre_build would swap the file before running maven test and package?) We are planning to have a separate application.properties file for dev and prod environments.

Bw, Ian

1 Answer
0

How about placing them in S3?
Then you can use "aws s3 cp" to copy the files.
For example, you might execute the following command.

aws s3 cp s3://example-s3/application.properties ./src/main/resources/

If this answer leads to a resolution, please approve the answer for the betterment of the community.

profile picture
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions