You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by js...@apache.org on 2023/12/08 06:50:18 UTC
(incubator-kie-kogito-pipelines) 01/02: add util method waitForDocker
This is an automated email from the ASF dual-hosted git repository.
jstastnycz pushed a commit to branch kie-issues_747
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git
commit 3b0c93f8af2fa2a40c15353104e0dd5e6e7767a5
Author: jstastny-cz <ja...@ibm.com>
AuthorDate: Fri Dec 8 07:49:41 2023 +0100
add util method waitForDocker
---
.ci/jenkins/Jenkinsfile.build-kogito-ci-image | 4 ++--
dsl/scripts/pr_check.groovy | 5 +++--
dsl/seed/jenkinsfiles/Jenkinsfile.buildchain | 1 +
jenkins-pipeline-shared-libraries/vars/util.groovy | 7 +++++++
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.build-kogito-ci-image b/.ci/jenkins/Jenkinsfile.build-kogito-ci-image
index b66c22ab..61023008 100644
--- a/.ci/jenkins/Jenkinsfile.build-kogito-ci-image
+++ b/.ci/jenkins/Jenkinsfile.build-kogito-ci-image
@@ -66,10 +66,10 @@ pipeline {
}
steps {
echo 'Init docker'
- sh 'wait-for-docker.sh'
+ util.waitForDocker()
echo 'Debug basics'
sh '''
- ps -p $$
+ sh --version
locale
printenv
'''
diff --git a/dsl/scripts/pr_check.groovy b/dsl/scripts/pr_check.groovy
index 59b5ec6b..49ab0fef 100644
--- a/dsl/scripts/pr_check.groovy
+++ b/dsl/scripts/pr_check.groovy
@@ -40,8 +40,9 @@ void launch() {
void launchInDocker(String builderImage) {
docker.image(builderImage).inside(dockerArgs.join(' ')) {
- // Debug. To be removed in the future
- sh "printenv"
+ sh 'printenv > env_props'
+ archiveArtifacts artifacts: 'env_props'
+ util.waitForDocker()
sh 'ls -last /var/run/docker.sock'
try {
launchStages()
diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
index d0a7e9db..912a3e68 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
@@ -62,6 +62,7 @@ pipeline {
script {
sh 'printenv > env_props'
archiveArtifacts artifacts: 'env_props'
+ util.waitForDocker()
sh 'ls -last /var/run/docker.sock'
if (mavenDeployArtifacts) {
diff --git a/jenkins-pipeline-shared-libraries/vars/util.groovy b/jenkins-pipeline-shared-libraries/vars/util.groovy
index 30e00587..ea5af6a9 100644
--- a/jenkins-pipeline-shared-libraries/vars/util.groovy
+++ b/jenkins-pipeline-shared-libraries/vars/util.groovy
@@ -547,3 +547,10 @@ String displayDurationFromSeconds(int durationInSec) {
result += "${seconds}s"
return result
}
+
+/**
+ * Method to wait for dockerd to be started. Put in initial pipeline stages to make sure all starts in time.
+ */
+void waitForDocker() {
+ sh 'wait-for-docker.sh' // script in kogito-ci-build image itself put in /usr/local/bin
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org