Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there anything wrong with a all inclusive custom image forpipeline?

Erfang Chen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2018

Here is what I plan to do in our Pipeline, please let me know if this violates any best practices

 

We typically deploy Java based app servers to AWS elastic beanstalk or lambda. Therefore, our image shall contain

 - mvn

 - python3

 - pip

 - awscli

 

But we also have custom JFrog instance hosting our artifacts, thus we need to mv our own {{settings.xml}} in {{/root/.m2/settings.xml}

This way, my 1 image can handle everything from running tests to upload the application JARs to AWS and without having to specify a {{mvn -s <path to settings>}} on each command

 

Does this violate any known best practices at all?

 

1 answer

1 accepted

1 vote
Answer accepted
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2018

Hi @Erfang Chen,

the approach that you describes sounds like a sensible thing to do. By creating your custom optimised image, you won't lose time installing dependencies on run time and thus make your overall build time smaller. 

I am not sure if you are planning to also put JFrog credentials in your settings.xml file - but if you do, make sure you make the Docker image private. Alternatively, you could write a simple script that injects your authentication credentials at runtime (where the credentials would be injected from Bitbucket Pipelines secured variables). This way you don't have to burn credentials into your Docker image. 

Erfang Chen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 23, 2018

Thanks @Jeroen De Raedt, this make sense. When you say inject credentials through Bitbucket Pipeline secured variables, you mean environment variables right? This is what our team is currently doing

Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2018

Correct, these ones: https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html 

You declare them in the Pipelines UI, and they will be made available as environment variables. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events