chore: improve the run_macaron.sh script#521
Merged
Merged
Conversation
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
…tory exists Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
1bca05d to
d1f6341
Compare
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
tromai
approved these changes
Oct 19, 2023
behnazh-w
reviewed
Oct 20, 2023
| "NO_PROXY" | ||
| "MAVEN_OPTS" | ||
| "GRADLE_OPTS" | ||
| "JAVA_OPTS" |
Member
There was a problem hiding this comment.
The main reason we pass MAVEN_OPTS and GRADLE_OPTS is to download mvnw and gradlew when proxy is set. With JAVA_OPTS we will pass a lot more options, potentially interfering with the JVM process. Have you encountered a case where JAVA_OPTS is absolutely necessary and the other environment variables cannot be used?
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Member
|
We use |
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
Member
Author
RST doc has been adjusted in 57e3c16. |
Contributor
|
The latest changes to the RST doc files look good to me. My approval still holds. |
behnazh-w
approved these changes
Oct 24, 2023
art1f1c3R
pushed a commit
that referenced
this pull request
Nov 29, 2024
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes a number of improvements to our current
run_macaron.shscript.This is to prepare for another pull request, #512, which adds support for Podman as an alternative container engine to run the Macaron image.
Set bash "strict" flags
Commit: 95cb003
The following bash built-in flags are added to the script. These flags effectively help make the script less error-prone.
set -e: exit immediately if a command fails (with non-zero return code), or if a function returns non-zero.set -u: treat unset variables and parameters as errors when performing parameter expansion.Note: In case a variable
${VAR}is unset but we still need to expand, we can use the syntax${VAR:-}to expand it to an empty string (bash documentation).set -o pipefail: set the return value of a pipeline to the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully.Reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html.
Simplify passing environment variables into the container
Commit: b4d49f0
During
docker run, we can pass environment variables into the container as follows:$ docker run [...] -e "http_proxy=${http_proxy}" [...]In cases where we want the container to "inherit" the environment variables on the host, we do not need to explicitly specify the value, i.e., doing this should be enough:
Passing the environment variables into the container in this implicit manner is also very useful when we want to use the
set -xflag of bash for debugging purposes but do not want secret values to be logged out as plain text.Inherit the
JAVA_OPTSenvironment variable into the containerCommit: d1f6341
Proxy settings for the Gradle wrapper can also be set through the
JAVA_OPTSenvironment variable (besidesGRADLE_OPTS). We should also pass it into the container.Other changes
analyzeandverify-policyare referred to, from "actions" to "commands".set -u, these functions canreturn 1and immediately stop the script with exit code 1.