jenkins-2

Jenkins delete jobs when branch deleted via branch-indexing

戏子无情 提交于 2019-11-30 02:15:30
问题 Is there a way to tell Jenkins (2.2) to remove jobs for branches that were deleted? Currently my build-monitor fills up with branches as the jobs are not deleted. Is there a setting to trigger this behavior or should this be filed as a bug? 回答1: Since you are using latest Jenkins version, consider switching your jobs to multibranch pipeline setup. The Workflow Multibranch feature (provided by the workflow plugin) provides the following key abilities: Automatic Workflow (job) creation in

How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request

我与影子孤独终老i 提交于 2019-11-29 20:41:17
It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs. How do you configure a pipeline job to be triggered from a GitHub pull request event? The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigger the pipeline job on the PR event? The most straightforward way to use Pipeline with GitHub pull requests is to put the script into your repository under the name Jenkinsfile and then install the GitHub Branch Source plugin. Documentation I had similar issue. Here’s what worked

How to configure a Jenkins 2 Pipeline so that Jenkinsfile uses a predefined variable

孤者浪人 提交于 2019-11-29 16:20:40
I have several projects that use a Jenkinsfile which is practically the same. The only difference is the git project that it has to checkout. This forces me to have one Jenkinsfile per project although they could share the same one: node{ def mvnHome = tool 'M3' def artifactId def pomVersion stage('Commit Stage'){ echo 'Downloading from Git...' git branch: 'develop', credentialsId: 'xxx', url: 'https://bitbucket.org/xxx/yyy.git' echo 'Building project and generating Docker image...' sh "${mvnHome}/bin/mvn clean install docker:build -DskipTests" ... Is there a way to preconfigure the git

How to set github commit status with Jenkinsfile NOT using a pull request builder

时光怂恿深爱的人放手 提交于 2019-11-28 20:30:21
We have Jenkins 2 set to build every push to github, and we do not use the Pull Request builder (although commits that are part of a pull request obviously will get built, as well). The GitHub Integration Plugin says that it only works with the pull request builder, so this won't work for us. I've also tried the github-notify plugin , but it seems not to work for our case (possibly because the repo is private and/or owned as part of an Organizaiton, rather than an individual user). I have tried letting it infer settings as well as manually specifying credentialsId , account , repo , and of

Jenkins: Trigger Multi-branch pipeline on upstream change

大憨熊 提交于 2019-11-28 17:35:01
I am currently testing the pipeline approach of Jenkins 2.0 to see if it works for the build environment I am using. First about the environment itself. It currently consists of multiple SCM repositories. Each repository contains multiple branches, for the different stages of the development and each branch is build with multiple configurations. Not all configurations apply to every repository. Currently every repository/branch is setup as a Matrix Project for the different configurations. Each project exposes it's building results as a artifact and these artifacts are used in the downstream

How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request

余生颓废 提交于 2019-11-28 16:47:31
问题 It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs. How do you configure a pipeline job to be triggered from a GitHub pull request event? The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigger the pipeline job on the PR event? 回答1: The most straightforward way to use Pipeline with GitHub pull requests is to put the script into your repository under the name

How to configure a Jenkins 2 Pipeline so that Jenkinsfile uses a predefined variable

℡╲_俬逩灬. 提交于 2019-11-28 11:02:21
问题 I have several projects that use a Jenkinsfile which is practically the same. The only difference is the git project that it has to checkout. This forces me to have one Jenkinsfile per project although they could share the same one: node{ def mvnHome = tool 'M3' def artifactId def pomVersion stage('Commit Stage'){ echo 'Downloading from Git...' git branch: 'develop', credentialsId: 'xxx', url: 'https://bitbucket.org/xxx/yyy.git' echo 'Building project and generating Docker image...' sh "$

How to set github commit status with Jenkinsfile NOT using a pull request builder

淺唱寂寞╮ 提交于 2019-11-27 12:58:23
问题 We have Jenkins 2 set to build every push to github, and we do not use the Pull Request builder (although commits that are part of a pull request obviously will get built, as well). The GitHub Integration Plugin says that it only works with the pull request builder, so this won't work for us. I've also tried the github-notify plugin, but it seems not to work for our case (possibly because the repo is private and/or owned as part of an Organizaiton, rather than an individual user). I have

Jenkins: Trigger Multi-branch pipeline on upstream change

依然范特西╮ 提交于 2019-11-27 10:20:59
问题 I am currently testing the pipeline approach of Jenkins 2.0 to see if it works for the build environment I am using. First about the environment itself. It currently consists of multiple SCM repositories. Each repository contains multiple branches, for the different stages of the development and each branch is build with multiple configurations. Not all configurations apply to every repository. Currently every repository/branch is setup as a Matrix Project for the different configurations.