Here\'s my Jenkins 2.x pipeline:
node (\'master\'){ stage \'Checkout\' checkout scm stage \"Build Pex\" sh(\'build.sh\') }
When
I compiled all the answers above and for me it worked like this:
stage('Run Script'){ steps { script { sh('cd relativePathToFolder && chmod +x superscript.sh && ./superscript.sh parameter1 paraeter2') } } }
Thanks to @Rafael Manzoni @Keith Mitchell and @Jayan