Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Env support #369

Merged
merged 4 commits into from
Mar 13, 2020
Merged

Add Env support #369

merged 4 commits into from
Mar 13, 2020

Conversation

anuruddhal
Copy link
Member

@anuruddhal anuruddhal commented Mar 10, 2020

import static org.ballerinax.docker.test.utils.DockerTestUtils.getExposedPorts;

/**
* Build with `buildImage` field set to false and check whether build command is shown.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the comment.

@@ -301,6 +304,9 @@ private String generateDockerfileForWindows() {
.append(FilenameUtils.separatorsToWindows(file.getTarget()))
.append("\n");
});
dockerModel.getEnv().forEach((key, value) -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we keep an empty line above ?

Map<String, String> env = new HashMap<>();
env.put("PASSWORD", "myP@$$worD");
setEnv(env);
ProcessOutput buildProcess = DockerTestUtils.compileBallerinaFile(sourceDirPath, "env.bal");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DockerTestUtils.compileBallerinaFile() function uses a process builder. I think we can pass env vars to the process so that the above setEnv function is not needed.

@codecov-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

Merging #369 into master will decrease coverage by 0.43%.
The diff coverage is 55.26%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #369      +/-   ##
============================================
- Coverage     65.53%   65.09%   -0.44%     
- Complexity      176      183       +7     
============================================
  Files            14       14              
  Lines           824      851      +27     
  Branches        114      119       +5     
============================================
+ Hits            540      554      +14     
- Misses          220      231      +11     
- Partials         64       66       +2     
Impacted Files Coverage Δ Complexity Δ
...g/ballerinax/docker/DockerAnnotationProcessor.java 76.97% <50.00%> (-5.20%) 25.00 <4.00> (+5.00) ⬇️
...erinax/docker/generator/DockerArtifactHandler.java 50.91% <58.33%> (-0.02%) 20.00 <1.00> (+1.00) ⬇️
...allerinax/docker/generator/models/DockerModel.java 80.64% <100.00%> (ø) 29.00 <1.00> (ø)
...org/ballerinax/docker/utils/DockerPluginUtils.java 80.95% <0.00%> (+2.38%) 16.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a45a36...4fa79c9. Read the comment docs.

@hemikak hemikak merged commit 188a4b9 into ballerina-platform:master Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants