Back to blog

DeltaBlue

Use your preferred language to create actions

x min read

Use your own preferred programming language to create platform actions. If it is PHP, Python, Ruby, ... we got you covered.Published on 7/23/2018Use your preferred language to create actions

Our cloud platform allows you to define any type of task that you want to run in a scenario.

Usually these actions are bash related instructions. For example: apt-get install, mkdir, ...

Not everybody is comfortable with writing bash scripts, especially when some logic or complex conditions are necessary.

To handle this, the platform supports the usage of the typical programming & scripting languages. Ranging from Python to PHP to NodeJS to Ruby. Any scripting language that does not require any compiling is available for you to use.

To use any of these languages in a "Task", you only have to change the first line in the "task".

An example to get you started:

Usually this would be #!/bin/bash but by changing this to #!/usr/bin/env php, the task will use the PHP binary. This "line" is referred to in the Unix worlds as "shebang".

Example of a task to read a file:

#!/usr/bin/env php

<?php

$my_file = '/opt/approot/file.txt';

// your logic....

By using the appropriate "shebang" the platform will try to execute using the binary indicated.

Other typical "shebang" options are:

  • #!/usr/bin/env php – Execute task using PHP
  • #!/usr/bin/env python – Execute task using Python
  • #!/usr/bin/env node – Execute task using NodeJS
  • #!/usr/bin/perl -T – Execute actions using Perl with the option for taint checks
  • #!/usr/bin/env ruby -w – Execute task using Ruby with warnings

Let's talk!

Have a question, need advice, or just want to learn more about what we offer? Our team is here to help! Whether you're exploring solutions, planning your next move, or already deep into a project. We'll connect you with the right experts to give you practical, honest input tailored to your situation.

From technical questions to partnership opportunities, we're all ears. Drop us a line and let's see where we can make a difference.

Contact us