I'm just getting started with Pipelines, and am trying to set one up that runs when commits are merged into our develop branch (the step/script stuff is already working when it's part of the default block; I just want to target specifically develop.)
I'm editing my bitbucket-pipelines.yml file in the online editor, and am getting a warning dot with error message when I use this config:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1
pipelines:
branches:
develop:
- step:
name: Transition Jira ticket to done
script:
- pipe: atlassian/jira-transition:0.1.4
variables:
JIRA_BASE_URL: $JIRA_BASE_URL
JIRA_USER_EMAIL: $JIRA_USER_EMAIL
JIRA_API_TOKEN: $JIRA_API_TOKEN
ISSUE: $BITBUCKET_BRANCH
TRANSITION: "Done"
The error is occurring on the "branches" and "develop" lines; the branches error says "branches requires pattern to target specific branches", and the develop error says "Unexpected property develop".
Where am I going wrong here?
UPDATE: I did get the branch pipeline to save, using this code:
pipelines:
default:
- step:
script:
- echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'."
branches:
develop:
- step:
script:
- pipe: atlassian/jira-transition:0.1.4
variables:
JIRA_BASE_URL: $JIRA_BASE_URL
JIRA_USER_EMAIL: $JIRA_USER_EMAIL
JIRA_API_TOKEN: $JIRA_API_TOKEN
ISSUE: $BITBUCKET_BRANCH
TRANSITION: "Done"
But now when I merge a commit to develop, the pipeline fails with this error:
<span>String "develop" does not contain issueKeys</span>
<span>Cannot find issue key</span>