TECHIES WORLD

For Techs.... Techniques.... Technologies....

BashLinux

How to run bash command using Jenkins pipeline

In-order to run bash commands, shebang "/bin/bash" need to be specified as the first line of the groovy script.

stage('Run bash command') {
    steps {
        sh '''#!/bin/bash
            echo "COMMAND" 
             '''
    }
}

Where COMMAND need to be replaced with the required bash command.

That's all…