I want to us YAML anchors but in the script of my anchor, I need to pass a variable of the version that I push to NPM. Is there a way to pass or define a variable that will be used in the YAML anchor?
Here's what I'm trying to achieve
definitions:
steps:
- step: &build
name: build
script:
- npm version $VERSION_NUMBER
pipelines:
branches:
master:
- step: *build
VERSION_NUMBER = 1.0.0 # I don't know how to do this
default:
- step: *build
VERSION_NUMBER = $BITBUCKET_BUILD_NUMBER-$BITBUCKET_BRANCH # I don't know how to do this
@Etienne Noel variables are not shared through artifacts, but you can put this string to text file and user VERSION_NUMBER: $(cat version.txt)
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.