I am new to bitbucket pipelines and trying to deploy my code via bitbucket pipelines by using javaScript. My question is can we declare variables like (ex: var flag = false) and then write if/else statements based the flag value.
Below is my pipelines.yml file
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:12.18.2
pipelines:
branches: # deploying as per branches
feature/pocDepTerex: # poc master branch
- step:
caches:
- node
script:
- node -v
Here, I want to declare a flag and run the script node -v only when the flag is true.
Please let me know if there is any way to do it in pipelines