SAP Business Application Studio Repetitive Task Automation Using Bash Scripts

SAP Business Application Studio is the new IDE on SAP BTP  Like its predecessor, SAP Web IDE Full-Stack, it provides a cloud-based development environment. However, it also brings some new concepts into the picture like Dev Spaces

Dev%20Space

Once you click Create Dev Space, SAP Business Application Studio will add a kind of private virtual machine for you and install all the selected extensions into it but behind the scenes, Kubernetes technology is used to manage containers to create a separate dev space. Once the dev space status turns to RUNNING, you can start your development.

Dev spaces are completely separate from one another, and you cannot access the file system and processes of one dev space from another dev space, even if both are created by the same developer. This level of isolation, together with the containers approach, enabled us to provide the long-requested terminal access and the ability to run almost any command as if you are working on your personal laptop.

Since BAS dev space is a Linux machine so it means we can run Linux BASH script on it and we can automate lots of repetitive tasks on it.
I have recently tried automation for lots of tasks using Bash Scripts on SAP BAS terminal as shown below one of the basic and simple examples is mentioned below-

Automate Cloud foundry login + Build + Deployment of your projects.

I have used below Bash Scripting language to automate my Cloud Foundry login and automate build and deploy my SAP CAP project from my workspace. You can use it for any type of project like HANA or SAP Fiori.

The above screenshot contains commands as explained below –

  • cf login commands which will start login and after that it will provide login credentials automatically to the system and set the dev space in cf.
  • After that, it will navigate to a specific folder using
  • Mtb built will build your project
  • Cf deploy will start the deployment

Above 4 steps we can automate every time we have to log in and deploy our project using Bash Scripting, we just need to run that script as mentioned below in our BAS project terminal.

The above automated task is just the tip of the iceberg we can do lots more automation in SAP BAS for example –

  • Automate deployment of multiple projects or select one based on user input.
  • After deployment automates your git operations.
  • Automatic Creating reusable folder structure and files with reusable code snippets.
  • Creating CF service instances for MTA apps.
  • Generating logs, monitoring the status of apps, etc.

I will suggest you try it for some of your daily repeated simple tasks first and then think of other new or complex areas where we can use it to make development simple on SAP BAS.

Kindly drop your ideas and hand on stories of automation on SAP BAS using this scripting language in the comments below.

Thank you.