Missed Team ’24? Catch up on announcements here.

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

Quick question about where to store script for pipeline

Deleted user February 1, 2022

For some reason I can't find this info anywhere. So I'm working on my first pipeline and I want to have it call a .sh script. Where should I store the .sh script for the pipeline below to be able to call it?

 

pipelines:
     branches: #anytime a branch push is performed
          prod_/*: #any branch with a prod_ prefix
               - step:
                    script:
                         - /bin/bash increment_version.sh

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 2, 2022

Hello @[deleted] ,

Thank you for reaching out to Atlassian Community.

Just to give you a background, every step in a Pipeline runs within a docker container, and the repository where the pipeline is running is always cloned into that container.

That said, you can store your script files anywhere within your repository, and reference it on your build step as you would normally do using shell.

Allow me to share some examples:

  • Executes a script stored in the root of the repository :
pipelines:
branches:
master:
- step:
script:
- /bin/bash my_script.sh
  • Executes a script stored in the folder my_folder of the repository :
pipelines:
branches:
master:
- step:
script:
- /bin/bash my_folder/my_script.sh

 

Hope that helps. Let me know in case you have any question.

Thanks @[deleted] !

Kind regards,

Patrik S.

Deleted user February 2, 2022

Awesome, thanks Patrik!

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events