Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 for Jenkins Documentation | 1.17.3

# p4tag: P4 Tag

Jenkins can tag builds automatically when the build completes. The Tags are stored in the Perforce P4 Server as Automatic Labels with the label view based on the workspace at the time of tagging.

## Example p4tag: P4Tag configuration

### Example generated script for p4tag: P4 Tag

The form above generates the following script snippet:

    p4tag(
        rawLabelDesc: 'Jenkins post-build label.',
        rawLabelName: 'jenkins-Swarm'
    )

### Paste the script snippet into a basic script

Example: the script snippet above has been pasted into a basic script:

    pipeline {
        agent any
        stages {
            stage('Tag') {
    			steps() {
    				// tag build when complete
    				p4tag(
    					rawLabelDesc: 'Jenkins post-build label.',
    					rawLabelName: 'jenkins-Swarm'
    				)
    			}
            }
        }
    }

## Configure a p4tag: P4Tag script

To create a P4Tag script, select p4tag: P4 Tag from the Sample Step dropdown

- Label Name: Enter the label name in the field.
- Description: Enter a description for the label,

### Generate Pipeline Script

To generate the pipeline script, click Generate Pipeline Script. The script is generated in the text box below the button.

Copy the generated script and paste it into the Script box on the Jenkins Pipeline Script page.

Your search for returned results