The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Self hosted windows runner executes yaml anchors in bash?

Dirk Schuermans
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 10, 2024

Given the following pipeline definition:

definitions:
common-items: #https://stackoverflow.com/a/79179771
- initialize: &initialize |
Import-Module ".\.bitbucket\Virto_Functions.psm1"
.\.bitbucket\initialize_step.ps1
pipelines:
  pull-requests:
    '**':
      - step:
          name: "Build & test"
          script:
           - $env:DISABLE_EAZFUSCATOR="true"
           - *initialize

My build then fails with the message

+ $env:DISABLE_EAZFUSCATOR="true"
bash: :DISABLE_EAZFUSCATOR=true: command not found

Any thoughts? It appears that it's executing this using bash and not powershell..

I have my entire pipeline working just fine using the documented YAML anchor functionality, but I stumbled upon this "hidden" feature on StackOverflow

I really want to have a way to re-use sets of scripts, instead of having to duplicate entire steps simply to leave out a few script lines

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Dirk Schuermans
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 11, 2024

Doh, major facepalm here.

I forgot to add the runs-on:

image.png

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events