Can we pass Bitbucket Variables to js File...

mehakfatima

Mehak Fatima

Posted on April 13, 2022

Can we pass Bitbucket Variables to js File...

Pre-Requisite:

  • How to use Bitbucket pipeline.
  • How to store Bitbucket variables.

Motivation:

As you know we can store variable inside Bitbucket repository and can use them inside the Yml file to enhance Security but can we use these variables inside js files?

let’s see…

Steps:

  • We can pass these variables to the file like this node Android.js $BITRISE_TOKEN.This command will run the Android.js with the parameter. we can extract this Parameter inside the file like this const buildArgs = process.argv.slice(2); buildArgs is the array here so we will extract value like this buildArgs[0] means value 1 buildArgs[1] means value 2.
💖 💪 🙅 🚩
mehakfatima
Mehak Fatima

Posted on April 13, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024