Hi, I'm new to groovy scripting and learning groovy and jenkins pipeline as code. I'm new to this groovy community/support platform as well. I'm not sure whether how relevant to post here. Requesting for help and direction
I have a test/assignment as below. Could any one kindly help with groovy skeleton code for the below use case. 1. To build the java code and deploy the jar file to Nexus URL. a. Assume all the Plugins are already present in the Jenkins. b. Groovy skeletons such as mvn command calls, nexus publish call, etc., are expected. c. Groovy Branching statements for deciding on whether to build or not needs to be considered as below. i. Any *.java file under the src directory needs a new build. ii. Any pom.xml file changes needs a new build. 2. To fetch only the updated GIT Repo Files and push it to Linux Host. a. Assume any pre-configured password ssh in Jenkins as you wish. b. Groovy skeletons such as usage of git command calls, authentication mechanisms, Linux push calls, etc., are expected. 3. To Run Existing Jenkins Job & Pipeline. a. Assume 1 Jenkins Job and 1 Pipeline is already configured with the names of your choice. b. Groovy skeletons such as run command calls, run outcome based on Groovy Branching Statements, etc., are expected. 4. To Backup, Deploy & Rollback in a Linux Host. a. Assume 1 custom Application & any backup location of your choice to back up the files which are going to be modified. b. Groovy skeletons such as run backup, deploy & rollback on deployment failure based branching logic, etc., are expected Thanks Ran