Skip to main content
All CollectionsKnowledge BaseHow To
Bitrise Script Step - Running (Bash, Python, NodeJS, Ruby, Swift, Kotlin)
Bitrise Script Step - Running (Bash, Python, NodeJS, Ruby, Swift, Kotlin)
Updated over 3 months ago

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
  • Where the contents of index.py is print('Hello, World!')

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
  • Where the contents of index.js is console.log("Hello World NodeJS");

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
  • Where the contents of index.rb is puts "Hello, World!"

Running this results in

Compiled Languages

Swift

Script Content

cat <<EOT >> hello.swift
  print("Hello World")
EOTchmod u+x hello.swiftswift hello.swift

Command to Run

/bin/bash

Filename of Script (Not Required)

Running this results in

Kotlin

Script Content

brew install kotlincat <<EOT >> main.kt
  fun main() {
    println("Hello, World!")
  }
EOTchmod 777 main.ktkotlinc main.kt -include-runtime -d hello.jarjava -jar hello.jar

Command to Run

/bin/bash

Filename of Script (Not Required)

Running this results in

Did this answer your question?