JobDSL: an example of configuring a bitbucket source trait of bitbucketForkDiscovery in the multibranchPipelineJob is wanted

2020-01-13 Thread Usov Dmitri


Hi All, 


I need an example of a JobDSL that can create a Jenkins multi branch 
pipeline job that is working against Bitbucket and configures the option of 
bitbucketTrustTeam.


An example that works for me with the "configure" DSL command follows: 

configure {

it / 'sources' / 'data' / 'jenkins.branch.BranchSource' / 'source' 
/ traits / 
'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' {

strategyId(1)

trust(class: 
"com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait\$TrustTeamForks")

}

}


What I need is to rewrite it in a more professional way with the pure DSL, 
something like

 bitbucketForkDiscovery {

 strategyId(1)

 trust(bitbucketTrustTeam)

 }

but having no success in passing the trust parameter, and having little 
experience in the matter I would like to ask the community for any help on 
the subject.


Regards,

Dmitri


An example that needs rewriting is here:


multibranchPipelineJob('my-build') {

displayName(‘my-build-multi-branch-pipeline')

description('My project')

branchSources {

branchSource {

source {

bitbucket {

 id('my-build-pipeline')

 serverUrl('https://bitbucket. ')

 credentialsId('bitbucket_creds')

 repoOwner('~myaccount')

 repository('my_repo')

 traits {

 bitbucketBranchDiscovery {

 strategyId(1)

 }

 bitbucketPullRequestDiscovery {

 strategyId(1)

 }

// bitbucketForkDiscovery {

// strategyId(1)

// trust(bitbucketTrustTeam)

// }

 bitbucketTagDiscovery()

 }

}

}

buildStrategies {

skipInitialBuildOnFirstBranchIndexing()

buildNamedBranches {

filters {

regex {


regex('master|development|feature-.+|staging-\\d+')

caseSensitive(false)

}

}

   

}

buildTags {

atLeastDays('0')

atMostDays('2')

}

buildChangeRequests {

ignoreTargetOnlyChanges(false)

ignoreUntrustedChanges(true)

} 

}

}

factory {

workflowBranchProjectFactory {

scriptPath('my_build_multibranch.jenkinsfile')

}

}

}

configure {

it / 'sources' / 'data' / 'jenkins.branch.BranchSource' / 'source' 
/ traits / 
'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' {

strategyId(1)

trust(class: 
"com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait\$TrustTeamForks")

}

}

orphanedItemStrategy {

discardOldItems {

daysToKeep(30)

numToKeep(2)

}

}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2df3eec4-3d87-4c31-84c1-2d7de5f4e5bf%40googlegroups.com.


Re: JobDSL: an example of configuring a bitbucket source trait of bitbucketForkDiscovery in the multibranchPipelineJob is wanted

2020-01-13 Thread Usov Dmitri
a fully working example will suite

On Tuesday, January 14, 2020 at 12:47:25 AM UTC+3, Victor Martinez wrote:
>
> You can use the dynamic DSL that it's specific for your installation, more 
> precisely 
> /plugin/job-dsl/api-viewer/index.html#method/jenkins.scm.api.SCMSource$$List.bitbucket
>  
> 
>
> Further details:
> - https://github.com/jenkinsci/job-dsl-plugin/wiki/Dynamic-DSL
>
> Cheers
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/adb01cd3-3790-416c-9161-dd1ec1427bcc%40googlegroups.com.


Re: kubernetes-plugin and PersistentVolumeClaims

2020-01-13 Thread Usov Dmitri
https://github.com/jenkinsci/kubernetes-cd-plugin

kubernetes-cd plugin has the capability to create a pvc, the recent plugin 
version has got fixed an issue with subsequent invocation of a yaml that 
creates/updates a pvc.

Regards,
Dmitri

On Tuesday, January 14, 2020 at 12:38:46 AM UTC+3, scottyg wrote:
>
> I have a use case where a PersistentVolumeClaim is used to clone a volume 
> snapshot, which is a prebuilt m2 repository. A PVC object needs to be 
> created before creating the Pod object, then deleted after the pod finishes.
>
> Using kubernetes-plugin, it seems that the yaml attribute in the 
> declarative pipeline only supports Pod objects. Before I go off and try to 
> figure out how to script the creation of a PVC object before launching the 
> Pod, I wanted to ask if there is a mechanism in this plugin that would help 
> manage a PVC lifecycle...and I'm just not seeing it. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/75ceecc2-1223-4398-a04c-882ccb230f97%40googlegroups.com.