Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to add tags to pipelines - doesn't accept tag name

I'm not sure why I can't specify what I thought was a simple name for the tags in the bitbucket-pipelines.yml

 

pipelines:

  tags:

    release-*:      

 

Using the validator the only way I can make this valid it to use * for the name of the tag after tags:. Anything else, even a single word like release gives me the error "Expected a List". I can't seem to find anywhere that details how this should work for identifying tags.

 

Validator - https://bitbucket-pipelines.prod.public.atl-paas.net/validator

 

1 answer

1 accepted

0 votes
Answer accepted

Hello @shilohuniversity,

Thanks for reaching out.

There's nothing wrong in the excerpt you posted. The validator is complaining on the missing content of release-* block: it has to be a list. That is, your config file is incomplete.

This is validated without any errors:

pipelines:
tags:
release-*:
- step:
script:
- echo "Hello world"

Hope this helps.

Cheers,
Daniil

Hi Daniil,

I was going fast and didn't actually add the entire script. Sorry for the confusion. Here is the whole script. Using release-* gives me an error in the validator:

pipelines:  
tags:
release-*:
-
step:
nameDeploy to Production
deploymentProduction
script:
ssh -tt $USER@$DOMAIN << EOF
cd $URL
touch newfilefromtag.tmp
exit $?
EOF

As I typed this in I realized that my formatting was off. Missing spaces in certain places. YAML is very picky. Here is the corrected code for reference:

pipelines:  
tags:
release-*:
- step:
name: Deploy to Production
deployment: Production
script:
- ssh -tt $USER@$DOMAIN << EOF
- cd $URL
- touch newfilefromtag.tmp
- exit $?
- EOF

Didn't have a space in between the dash and step. Also, needs 4 spaces below the step before name:

Thanks for your help!

Like Daniil Penkin likes this

Glad that it worked!

Missing spaces in certain places. YAML is very picky.

Yeah, this is a tradeoff of its conciseness, compared to JSON.

By the way, aside from the online validator there's at least a couple of plugins I'm aware of for IDEs which might help with debugging/validating Pipelines config file locally:

  • AtlasCode plugin for Visual Studio Code does a lot of things, but also bundles a JSON schema for bitbucket-pipelines.yml.
  • Bitbucket Linky plugin for IntelliJ IDEs also contains a JSON schema as well as some additional validations and inspections for bitbucket-pipelines.yml. Disclaimer: I'm the maintainer of this plugin

Hope this helps.

Cheers,
Daniil

Thanks! I just downloaded those plugins to try them out. Hoping that will help out with these formatting syntax errors in the future.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,119 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you