Details
-
Type:
Task
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: p4-plugin
-
Labels:
-
Similar Issues:
Description
Hi,
How can I use p4 groovy in declarative pipeline?
Karl Wirth, you told me that I can use below syntax, but I can't use this.
pipeline { agent { kubernetes { label 'test' yamlFile 'test.yaml' } } options { skipDefaultCheckout() } stages { stage('Run Test') { steps { container(name: 'test', shell: '/bin/bash') { p4 credential: 'p4_10.251.245.74_1667_perforce', workspace: templateSpec(charset: 'utf8', format: 'jenkins-${JOB_NAME}-${BUILD_ID}-${NODE_NAME}', pinHost: false, templateName: 'TEMPLATE') // and how to use p4.run('client', '-o') for example } } } } }
Hi Hokwang Lee. P4Groovy is scripted pipeline code so please try a 'script' block as described in:
https://jenkins.io/doc/book/pipeline/syntax/
For example: