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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.