Can we pass Bitbucket Variables to js File...
Mehak Fatima
Posted on April 13, 2022
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 thisconst buildArgs = process.argv.slice(2);
buildArgs is the array here so we will extract value like thisbuildArgs[0]
means value 1buildArgs[1]
means value 2.
💖 💪 🙅 🚩
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.