Skip to content

Commit c8a61c3

Browse files
committed
DATREDIS-1380 - Configure user.name and user.home for CI jobs.
Because the CI server runs in a secured, reduced privilege mode, setting the JDK's user.name and user.home variables via MAVEN_OPTS is required.
1 parent 755a78c commit c8a61c3

File tree

3 files changed

+10
-117
lines changed

3 files changed

+10
-117
lines changed

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 0 additions & 110 deletions
This file was deleted.

Jenkinsfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,20 @@ pipeline {
3636
agent {
3737
docker {
3838
image 'springci/spring-data-openjdk8-with-redis-5.0:latest'
39-
args '-v $HOME/.m2:/root/.m2'
39+
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
4040
}
4141
}
4242
steps {
43+
sh 'rm -rf \\?'
44+
4345
// Create link to directory with Redis binaries
4446
sh 'ln -sf /work'
4547

4648
// Launch Redis in proper configuration
4749
sh 'make start'
4850

4951
// Execute maven test
50-
sh "./mvnw clean test -DrunLongTests=true -B"
52+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean test -DrunLongTests=true -B'
5153

5254
// Capture resulting exit code from maven (pass/fail)
5355
sh 'RESULT=\$?'
@@ -57,6 +59,7 @@ pipeline {
5759

5860
// Return maven results
5961
sh 'exit \$RESULT'
62+
6063
}
6164
}
6265
}
@@ -69,7 +72,7 @@ pipeline {
6972
agent {
7073
docker {
7174
image 'adoptopenjdk/openjdk8:latest'
72-
args '-v $HOME/.m2:/root/.m2'
75+
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
7376
}
7477
}
7578

@@ -78,7 +81,7 @@ pipeline {
7881
}
7982

8083
steps {
81-
sh "./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B"
84+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
8285
}
8386
}
8487

@@ -89,7 +92,7 @@ pipeline {
8992
agent {
9093
docker {
9194
image 'adoptopenjdk/openjdk8:latest'
92-
args '-v $HOME/.m2:/root/.m2'
95+
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
9396
}
9497
}
9598

@@ -98,7 +101,7 @@ pipeline {
98101
}
99102

100103
steps {
101-
sh "./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B"
104+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
102105
}
103106
}
104107
}

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ All of these use cases are great reasons to essentially run what the CI server d
130130

131131
IMPORTANT: To do this you must have Docker installed on your machine.
132132

133-
1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-redis-github adoptopenjdk/openjdk8:latest /bin/sh`
133+
1. `docker run -it --mount type=bind,source="$(pwd)",target=/spring-data-redis-github springci/spring-data-openjdk8-with-redis-5.0:latest /bin/bash`
134134
+
135135
This will launch the Docker image and mount your source code at `spring-data-redis-github`.
136136
+

0 commit comments

Comments
 (0)