Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #73 from raul-arabaolaza/INFRA-1534-0
[INFRA-1534] Using a volume for maven settings file caused a lot of problems
  • Loading branch information
oleg-nenashev committed Apr 11, 2018
2 parents b126e3d + c56c85d commit 82286e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -49,12 +49,13 @@ The image will be able to determine this ID automatically if `CHECKOUT_SRC` or `
* `CHECKOUT_SRC` - Custom Git clone source (e.g. `https://github.com/oleg-nenashev/job-restrictions-plugin.git`). `https://github.com/jenkinsci/${ARTIFACT_ID}-plugin.git` by default
* `JAVA_OPTS` - Java options to be passed to the PCT CLI
* `DEBUG` - Boolean flag, which enables the Remote Debug mode (port == 5000)
* `M2_SETTINGS_FILE` - If set indicates the path of the custom maven settings file to use (see volumes below)

Volumes:

* `/pct/plugin-src` - Plugin sources to be used for the PCT run. Sources will be checked out if not specified
* `/pct/jenkins.war` - Jenkins WAR file to be used for the PCT run
* `/pct/m2-settings.xml` - Custom Maven Settings file (optional)
* `/pct/m2-settings.xml` - Custom Maven Settings (optional) if `M2_SETTINGS_FILE` environment variable exists `run-pct` will ignore this location and use the one specified in the variable
* `/pct/out` - Output directory for PCT. All reports will be stored there
* `/pct/tmp` - Temporary directory. Can be exposed to analyze run failures
* `/root/.m2` - Maven repository. It can be used to pass settings.xml or to cache artifacts
Expand Down
10 changes: 5 additions & 5 deletions src/main/docker/run-pct.sh
Expand Up @@ -17,9 +17,11 @@ if [ -n "${ARTIFACT_ID}" ]; then
echo "Running PCT for plugin ${ARTIFACT_ID}"
fi

if [ -f "/pct/m2-settings.xml" ] ; then
echo "Using a custom Maven settings file specified by the volume"
MVN_SETTINGS_FILE="/pct/m2-settings.xml"
CUSTOM_MAVEN_SETTINGS=${M2_SETTINGS_FILE:-"/pct/m2-settings.xml"}

if [ -f "${CUSTOM_MAVEN_SETTINGS}" ] ; then
echo "Using a custom Maven settings file"
MVN_SETTINGS_FILE="${CUSTOM_MAVEN_SETTINGS}"
else
MVN_SETTINGS_FILE="/pct/default-m2-settings.xml"
fi
Expand Down Expand Up @@ -74,8 +76,6 @@ if [[ "$DEBUG" ]] ; then
)
fi



###
# Checkout sources
###
Expand Down

0 comments on commit 82286e4

Please sign in to comment.