Greetings folks! Just ran into some weird issues w...
# community-support
a
Greetings folks! Just ran into some weird issues with Gradle 8.11 running on Jenkins. It looks like Gradle is not picking up my System.getenv(). Anyone else experiencing this issue? Pipeline snippet:
Copy code
stage('Push Image') {
            steps {
                withDockerRegistry(credentialsId: 'docker-registry') {
                    sh '''
                        export DOCKER_CONFIG=${DOCKER_CONFIG}
                        gradle pushImage
                    '''
                }
            }
        }
results in:
Copy code
2024-11-20T16:41:35.209  + export 'DOCKER_CONFIG=/var/jenkins_home/workspace/Build_Docker_Images_job_tmp/a182165e-2434-45fe-aba4-b83d1ae61d8b'

        2024-11-20T16:41:37.341  > Task :app:pushImage FAILED
        2024-11-20T16:41:37.341  [PATH:/var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/GRADLE_8_11/gradle-8.11/bin:/var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/GRADLE_8_11/gradle-8.11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/default-jvm/bin, TZ:Europe/Berlin, JAVA_OPTS:-Dfile.encoding=UTF8, LD_LIBRARY_PATH:/usr/lib/jvm/java-17-amazon-corretto/lib/server:/usr/lib/jvm/java-17-amazon-corretto/lib:/usr/lib/jvm/java-17-amazon-corretto/../lib, PWD:/var/jenkins_home/workspace/Build_Docker_Images, LANGUAGE:en_US.UTF-8, BUILD_TAG:jenkins-Build_Docker_Images-145, STAGE_NAME:Clean, JENKINS_HOME:/var/jenkins_home, NODE_NAME:docker-agent-0005meblygbmm, BUILD_DISPLAY_NAME:#145, LC_ALL:en_US.UTF-8, SHLVL:3, GIT_PREVIOUS_COMMIT:8ef95ba05b9c381167598069d716ace83add1048, WORKSPACE_TMP:/var/jenkins_home/workspace/Build_Docker_Images_job_tmp, SOPS_VERSION:3.9.1, JAVA_HOME:/usr/lib/jvm/default-jvm, BUILD_ID:145, LANG:en_US.UTF-8, JOB_NAME:Build_Docker_Images, GRADLE_USER_HOME:.gradle, JAVA_TOOL_OPTIONS:-Dfile.encoding=UTF8, HOME:/var/jenkins_home]
Well, guess I found it on my own https://github.com/gradle/gradle/issues/30743
t
Fwiw, you' using
'''
so that
${DOCKER_CONFIG}
is interpreted by the shell, so if there's already a
DOCKER_CONFIG
environment variable you shouldn't need that
export
line. Either that or there's no such environment variable and then
${DOCKER_CONFIG}
expands to the empty string. So maybe change to
"""
?
a
thanks for the heads-up. It's been working perfectly fine with older Gradle versions
So I'm fairly sure it's the linked issue I'm facing :)
👍 1
Guess I'll have to stick with
--no-daemon
for the respective tasks