Thursday 30 November 2017

Execute Shell in Jenkins - Update Permissions Example

Hello guys. How's it going? In today's post, let us look into an example of how to execute a shell command in Jenkins.

For illustration, let us consider a Java based project which is under IBM Clearcase source control and built using Maven on a Linux machine. Now we want to execute a bash command to update the permissions of all pom.xml files (i.e Parent pom's and Child pom's).

Check a few sample commands for reference :

find $WORKSPACE/$CLEARCASE_VIEWNAME/PROJECT_SRC_CVOB/SRC -type f -name pom.xml -exec chmod 755 {} \;

find $WORKSPACE/$CLEARCASE_VIEWNAME/PROJECT_SRC_CVOB/SRC -type f -name pom.xml -exec chmod 444 {} \;

find $WORKSPACE/$CLEARCASE_VIEWNAME/PROJECT_SRC_CVOB/SRC -type f -name pom.xml -exec chmod 777 {} \;

Hope it helps. Ciao!

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker