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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.