Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8990636a3 |
@@ -6,6 +6,8 @@ Environment variables
|
|||||||
- `MAVEN_SETTINGS_BASE64` (preferred): base64-encoded contents of the `settings.xml`. If present, the entrypoint will decode it and write it to `~/.m2/settings.xml`.
|
- `MAVEN_SETTINGS_BASE64` (preferred): base64-encoded contents of the `settings.xml`. If present, the entrypoint will decode it and write it to `~/.m2/settings.xml`.
|
||||||
- `MAVEN_SETTINGS`: raw contents of the `settings.xml`. Used only if `MAVEN_SETTINGS_BASE64` is not set.
|
- `MAVEN_SETTINGS`: raw contents of the `settings.xml`. Used only if `MAVEN_SETTINGS_BASE64` is not set.
|
||||||
|
|
||||||
|
- `MAVEN_SETTINGS_PATH`: path to the `settings.xml` inside the container (exported by the entrypoint). Typically `/home/ci/.m2/settings.xml` or `~/.m2/settings.xml` depending on the user; use this variable in scripts to locate the file reliably.
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
- The entrypoint will create `~/.m2` if it does not exist and set the `settings.xml` file to mode `644`.
|
- The entrypoint will create `~/.m2` if it does not exist and set the `settings.xml` file to mode `644`.
|
||||||
- Use `MAVEN_SETTINGS_BASE64` when your CI system has trouble preserving newlines or special characters in environment variables.
|
- Use `MAVEN_SETTINGS_BASE64` when your CI system has trouble preserving newlines or special characters in environment variables.
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ set -euo pipefail
|
|||||||
# then exec the container command.
|
# then exec the container command.
|
||||||
|
|
||||||
M2_DIR="${HOME:-/root}/.m2"
|
M2_DIR="${HOME:-/root}/.m2"
|
||||||
|
SETTINGS_FILE="$M2_DIR/settings.xml"
|
||||||
|
# Export the path to the settings.xml so downstream processes can read it
|
||||||
|
export MAVEN_SETTINGS_PATH="$SETTINGS_FILE"
|
||||||
|
|
||||||
if [[ -n "${MAVEN_SETTINGS_BASE64:-}" ]]; then
|
if [[ -n "${MAVEN_SETTINGS_BASE64:-}" ]]; then
|
||||||
mkdir -p "$M2_DIR"
|
mkdir -p "$M2_DIR"
|
||||||
|
|||||||
Reference in New Issue
Block a user