Why should I create custom script step:
While Bitrise provides hundreds of pre-made workflow steps for the most frequent use cases, we can't cover every possible scenario, so customer scripts may be required from time to time. Bitrise offers the Script Step (the default is Bash), which enables you to write code in the programming language of your choice to complete the task.
Following is the list of custom script example running in Bash, Python, NodeJS, Ruby, Swift, Kotlin:
Bash
Script Content
echo "Hello World!"
Command to Run
/bin/bash
Filename of Script (Not Required)
Running this results in
Python
Script Content
print('Hello, World!')
Command to Run
python
Filename of Script
index.py
Results in the following command running
python index.py
Running this results in
NodeJS
Script Content
console.log("Hello World NodeJS");
Command to Run
node
Filename of Script
index.js
Results in the following command running
node index.js
Running this results in
Ruby
Script Content
puts "Hello, World!"
Command to Run
ruby
Filename of Script
index.rb
Results in the following command running
ruby index.rb
Running this results in
Compiled Languages
Swift
Script Content
cat <<EOT >> hello.swift
print("Hello World")
EOT
chmod u+x hello.swift
swift hello.swift
Command to Run
/bin/bash
Filename of Script (Not Required)
Running this results in
Kotlin
Script Content
brew install kotlin
cat <<EOT >> main.kt
fun main() {
println("Hello, World!")
}
EOT
chmod 777 main.kt
kotlinc main.kt -include-runtime -d hello.jar
java -jar hello.jar
Command to Run
/bin/bash
Filename of Script (Not Required)
Running this results in