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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,564
Community Members
 
Community Events
176
Community Groups

Quick question about where to store script for pipeline

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 Feb 02, 2022

Hello @Michael Pietrefesa ,

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 @Michael Pietrefesa !

Kind regards,

Patrik S.

Awesome, thanks Patrik!

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events