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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What is the scripting language used in pipeline script?

I was not able to find this in the documentation: What is the scripting language used in pipeline script? Is it a list of Bash commands? Can we use another language?

2 answers

1 accepted

0 votes
Answer accepted

I did a test with the default image. I had a single command for my script:

echo $0

and the result was:

/opt/atlassian/pipelines/agent/tmp/bashScript1621852925964126991.sh

So we can assume it is a GNU Bash script.

Amending to our accepted answer, because it is misleading. The yaml is not a bash script, the yaml is currently interpreted and eventually executed as a bash script. 

I wanted to know what is the language used to interpret the lines of the script section. It seems to be BASH. For YAML, it just a list of strings. That does not tell how these lines are interpreted by saying it is YAML.

 

This is odd that the documentation does not specify this important technicality.

It's called yaml, it's a configuration language more-or-less.

You can read about how they use it here:

https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html

 

You can always use "Make" or "Ant" or bash scripts, you'd just make that your step like:

pipelines:
    default:
        -
step: name: "Build and Run Tests"
            script:
                -
make clean all

                - scripts/someShellScript.sh

Quick note: You might have issues with execute permissions, I've had to grant my scripts execute with a "- chmod +x somedir/somescript.sh

Hope that helps.

What I would like to know is when you write (like in your example):

make clean all

, in what language are we? Is it Bash? Is it something else? Can we change the default?

Everything in the bitbucket-pipelines.yml file is in yaml. I don't believe bitbucket supports anything but yaml for configuring their pipelines. The yaml file is used as the bridge between "What bitbucket knows about" and "how you want to build your source". 

The script section in the step section you can think of as commands that it will pass into the build runner image in the working directory - essentially at the root of your source for that repo/pipeline.

So in the case of "make clean all" the pipeline will attempt to run "make" with the arguments of "clean all" within the virtual machine/container that is attempting to build my code. If "make" is not found you'd get an error that'd youd see in the logs, just like you would in windows, ubuntu, alpine, whatever.

In my case, I have a custom image for my pipelines. It's an ubuntu image, with build-essentials installed, so I have make. In my root of my source I have a Makefile that has targets for "clean" and "all"

I found a solution but I cannot reply.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across Jira Cloud instance.   📢 Get y...

115 views 6 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you