docker-archive-public/docker.labs

Do we need to add environment variables to Jenkins?

Opened this issue · 0 comments

About this page, I followed the instructions along the way, but build failed.

The console output is like below.

I think that the environment variables JAVA_HOME (value: /opt/java/openjdk), PATH (value: /opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin) need to be added to the Jenkins System Configuration.

Started by user jenkins
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/ci-test
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/ci-test/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/fabianenardon/mongo-docker-demo.git # timeout=10
Fetching upstream changes from https://github.com/fabianenardon/mongo-docker-demo.git
 > git --version # timeout=10
 > git --version # 'git version 2.20.1'
 > git fetch --tags --force --progress -- https://github.com/fabianenardon/mongo-docker-demo.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision dfb83068c27c62f0268613ee02ab89204613b6f7 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f dfb83068c27c62f0268613ee02ab89204613b6f7 # timeout=10
Commit message: "Added testing instructions"
 > git rev-list --no-walk dfb83068c27c62f0268613ee02ab89204613b6f7 # timeout=10
[ci-test] $ /bin/sh -xe /tmp/jenkins8286753912285544023.sh
+ cd sample
+ sudo -E /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/maven/bin/mvn clean install -Papp-docker-image
Error: JAVA_HOME is not defined correctly.
  We cannot execute /docker-java-home/bin/java
Build step 'Execute shell' marked build as failure
[PostBuildScript] - [INFO] Executing post build scripts.
[ci-test] $ /bin/sh -xe /tmp/jenkins152989329278895156.sh
+ cd sample
+ sudo -E docker-compose -p app-4 --file src/test/resources/docker-compose.yml down
Removing network app4_default
Network app4_default not found.
Finished: FAILURE