-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add Env support #369
Conversation
8ad5973
to
22dba80
Compare
import static org.ballerinax.docker.test.utils.DockerTestUtils.getExposedPorts; | ||
|
||
/** | ||
* Build with `buildImage` field set to false and check whether build command is shown. |
There was a problem hiding this comment.
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) -> { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 Report
@@ 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
Continue to review full report at Codecov.
|
Purpose