The purpose of this example is to showcase all available features in PFO. It should help you to kickoff your config with a quick copy paste, and try field behaviours in your environment.
This example includes a:
bitbucket-pipelines.yml - needed for pipeline configuration
pipeline-forms.yml - needed for forms configuration
STEP 1 - bitbucket-pipelines.yml
Pipelines should be enabled in the Repository settings / Pipelines / Settings menu
After this you should navigate to your bitbucket-pipelines.yml and edit the file. It can be done from:
the UI editor in Bitbucket
any text editor you use for version control
image:node:18definitions:caches:sonar:/root/.sonar/cachefrontend-node:static/frontend/node_modulessteps: - step:name:Templatesscript: - &build-backend-script| npm install npm run build - &cd-frontend-run-install-script| cd ./static/frontend npm install -f - &build-frontend-script| cd ./static/frontend npm install -f npm run build - &cd-forge| cd forge - &cd-root| cd ../../pipelines:custom:Demonstration pipeline: - step:name:Custom Stepscript: - echo "This step will run on a cloud runner."; - printenvPipeline without forms: - step:name:Custom Stepscript: - echo "This step will run on a cloud runner."; - printenv
Commit your changes.
STEP 2 - pipeline-forms.yml
Open your source code and add a new file on the root level, next to bitbucket-pipelines.yml, named pipeline-forms.yml.
If you struggle creating this file, check out this part of the documentation:
Edit the file with the following content:
groups: - label:Mega Presetkey:MEGAfields: - &atlassian_base-url-text-fieldlabel:Atlassian base URLtype:textname:ATLASSIAN_BASE_URLdefaultValue:https://bitbucket.orgmandatory:truenote:Atlassian base URL - &workspace-text-fieldlabel:Workspacetype:textname:WORKSPACEmandatory:truenote:Bitbucket workspace - &repository-text-fieldlabel:Repositorytype:textname:REPOSITORYmandatory:truenote:Bitbucket repository - &bitbucket-site-url-text-fieldlabel:Target Bitbucket site URLtype:textname:SITE_URLmandatory:truenote:Target bitbucket site URL - &environment-text-fieldlabel:Environmenttype:textname:ENVIRONMENTmandatory:truenote:production or staging or other dev environment - &forge-email-text-fieldlabel:Atlassian account emailtype:textname:FORGE_EMAILmandatory:truenote:Atlassian account email - &forge-password-text-fieldlabel:Forge API tokentype:textname:FORGE_API_TOKENmandatory:truesecure:truenote:Forge api token - &example-text-fieldlabel:Text fieldtype:textname:EXAMPLE_TEXT - &example-regex-text-fieldlabel:Regex test fieldtype:textname:EXAMPLE_REGEX_TEXTregex:^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$note:Valid email addresses only - &example-select-fieldlabel:Menutype:selectname:EXAMPLE_SELECTreadonly:truedefaultValue:SoupavailableValues: - Soup - Meal - Dessert - &example-remote-select-fieldlabel:Remote Jira versiontype:remote_selectname:EXAMPLE_REMOTE_SELECTavailableValues:url:"https://hub.docker.com/v2/repositories/atlassian/jira-software/tags/?page=1&page_size=100&name=8"path:"$.results.[*].name" - &example-number-fieldlabel:Numberstype:numbername:EXAMPLE_NUMBER - &example-textarea-fieldlabel:Big input heretype:textareaname:EXAMPLE_TEXTAREA - &example-checkbox-fieldlabel:Agreementtype:checkboxname:EXAMPLE_CHECKBOX - &example-checkbox-group-fieldlabel:Select any optionstype:checkbox_groupname:EXAMPLE_CHECKBOX_GROUPavailableValues: - Jira - Confluence - Bitbucket - Other - &example-radio-fieldlabel:Which radio are you listening?type:radioname:EXAMPLE_RADIOavailableValues: - Radio 1 - Blues Radio - HipHop Radio - Other - &example-date-fieldlabel:Deadlinetype:datename:EXAMPLE_DATEforms: - name:Run selenium testsfields: - *atlassian_base-url-text-field - *workspace-text-field - *repository-text-fieldpipeline:run-e2e-tests - name:Upgrade appfields: - *forge-email-text-field - *forge-password-text-field - *bitbucket-site-url-text-field - *environment-text-fieldpipeline:upgrade-installed-app - name:Example with all fieldsfields: - *example-text-field - *example-regex-text-field - *example-select-field - *example-remote-select-field - *example-number-field - *example-textarea-field - *forge-password-text-field - *example-checkbox-field - *example-checkbox-group-field - *example-radio-field - *example-date-fieldpipeline:Demonstration pipelinegroups: - MEGA - name:Example with all overwritten fieldsfields: - <<:*example-text-fieldmandatory:true - <<:*example-select-fieldreadonly:falsedefaultValue:Meal - <<:*example-textarea-fieldmandatory:true - <<:*example-checkbox-fielddefaultValue:truereadonly:truepipeline:Demonstration pipelinegroups: - MEGA
Commit your changes.
STEP 3 - Open Pipeline Forms
From the sidebar, open the Pipeline Forms menu.
Select your commit and select the form named "Example with all fields".