jenkins-pipeline

Jib-Maven-plugin with Jenkins scripted pipeline: how to log in to private docker registry?

家住魔仙堡 提交于 2021-02-19 05:20:29
问题 Regarding this problem, I updated my JHipster-Application with scripted Jenkins pipeline and have now in Jenkinsfile (partly following these hints): [...] def dockerImage withEnv(["DOCKER_CREDS=credentials('myregistry-login')"]) { stage('publish docker') { sh "./mvnw -X -ntp jib:build" } } with Jenkins global credentials myregistry-login saved in my Jenkins-Server to my own docker registry v2 docker-container https://myregistry.mydomain.com (domain changed for security reasons). I can

Jenkins Pipeline does not run with docker-compose because it cant connect to docker daemon

别来无恙 提交于 2021-02-19 03:19:36
问题 I am trying to build an docker image and start the container with docker-compose inside a Jenkins pipeline. I have a custom docker image for my Jenkins where I use the Jenkins out of the box image and install Docker CE and docker compose. The Dockerfile: FROM jenkins/jenkins:2.159 USER root # create dir to save jenkins log files RUN mkdir /var/log/jenkins RUN chown -R jenkins:jenkins /var/log/jenkins #############################################################################################

How to use Jenkins pipeline `options` correctly

霸气de小男生 提交于 2021-02-18 21:12:09
问题 Snippet generator created a properties block for me. First run reported WorkflowScript: 1: The properties section has been renamed as of version 0.8. Use options instead. @ line 1, column 1. pipeline { Replacing properties to options results with the following error: Errors encountered validating Jenkinsfile: WorkflowScript: 4: options can not be empty @ line 4, column 5. options([$class: 'ThrottleJobProperty', Here is the full jenkinsfile for reference pipeline { agent any options([[$class:

Access which stage failed in previous Jenkins build

喜你入骨 提交于 2021-02-18 20:39:35
问题 I have written a Jenkinsfile script which gets whether documents are updated or code is updated in the current Github commit and starts all the stages accordingly. If only documents are updated I don't run the code testing stage again. So now if the previous build failed and now in the current Git commit only documents are updated then it will not run the code testing stage. So I want a method/way to know which stage failed during the last Jenkins build and if needed run the current Jenkins

How to cache local Maven repository using Docker with Pipelines?

混江龙づ霸主 提交于 2021-02-18 11:24:31
问题 I want to run my Maven builds in a Docker container. I don't want to upload all depenedencies with every build, so I tried to mount host's local Maven repository as documented at Using Docker with Pipeline: Caching data for containers [...] Pipeline supports adding custom arguments which are passed to Docker, allowing users to specify custom Docker Volumes to mount, which can be used for caching data on the agent between Pipeline runs. The following example will cache ~/.m2 between Pipeline

Triggering a multibranch pipeline job from an other multibranch pipeline

空扰寡人 提交于 2021-02-18 06:42:40
问题 I have a scenario where but I have 2 projects (A and B), both are configured in Jenkins with multibranch pipeline jobs, problem is that Project B depends on Project A. So I find that some times when I check in code in Project A, I also need to build ProjectB once A was built. Now before I started investigating pipeline builds, I'd have a job per branch and then trigger in Jenkins the appropriate job for Project B for the appropriate branch. What I'd like to set up in a Jenkinsfile so that

Visualize Jenkins pipeline or multibranch pipeline jobs

允我心安 提交于 2021-02-17 22:12:39
问题 I have one Pipeline job for each component in my Jenkins 2.0. All of them consist of many stages (build, UT, IT etc.), so they're working as a pipeline for a component. The components are depending on each other in a specified order, so I used "Build after other projects are built" (I also tried JobFanIn Plugin) to trigger these "mini-pipelines" after each other. This works like a pipeline of "mini pipelines" I'd like to visualize the relationship between the jobs. For this purpose I've found

Visualize Jenkins pipeline or multibranch pipeline jobs

三世轮回 提交于 2021-02-17 22:11:43
问题 I have one Pipeline job for each component in my Jenkins 2.0. All of them consist of many stages (build, UT, IT etc.), so they're working as a pipeline for a component. The components are depending on each other in a specified order, so I used "Build after other projects are built" (I also tried JobFanIn Plugin) to trigger these "mini-pipelines" after each other. This works like a pipeline of "mini pipelines" I'd like to visualize the relationship between the jobs. For this purpose I've found

Visualize Jenkins pipeline or multibranch pipeline jobs

不问归期 提交于 2021-02-17 22:10:18
问题 I have one Pipeline job for each component in my Jenkins 2.0. All of them consist of many stages (build, UT, IT etc.), so they're working as a pipeline for a component. The components are depending on each other in a specified order, so I used "Build after other projects are built" (I also tried JobFanIn Plugin) to trigger these "mini-pipelines" after each other. This works like a pipeline of "mini pipelines" I'd like to visualize the relationship between the jobs. For this purpose I've found

Jenkins generate new parameters based on another parameter value

泄露秘密 提交于 2021-02-17 05:01:31
问题 I have a choice parameter called 'Data Center' which has two values DC01 and DC02. If user chooses DC01 I want few other build parameters to show up, if he chooses DC02 I want other parameters to show up. Is there any way to do it? If user chooses DC01, I want two more fields such as 'hostname' and 'IP address' which are just text fields. I have tried using Active Choice Plugin, but I don't think we can generate text field parameters using that. Can anyone help? 回答1: We can generate text