Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Anchor and Tag

Nawang Lama February 1, 2024
pkg_build_script:
   - script: &pkg_build_script |-
      export PRODJECT="*8979879"
      env
      echo "Building Packages for call-${PKG_NAME}"



pipelines:
  branches:
    develop:
       - parallel: *parallel_package_steps
       - stage:
             name: Display New Package List
             steps:
             - step:
                  script:
                       - sh EXEUCTING SOMETHING BEFORE
                       - *pkg_build_script
                       - sh EXEUCTING SOMETHING AFTER


can I use this kind of anchor or tag or it needs to be defined under definitions.

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2024

Hi @Nawang Lama,

You can use an anchor like this as long as you include it in the definitions. You will need to remove the - before the script from the definition.

An example definition that works is the following:

definitions: 
scripts:
my_script: &pkg_build_script |-
export PRODJECT="*8979879"
env
echo "Building Packages for call-${PKG_NAME}"

Please feel free to let me know if that works for you or if you're experiencing any issues.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events