From a9e729cbc0f98b1025eece07f1c711e674191ad7 Mon Sep 17 00:00:00 2001 From: Michael Jenkins Date: Thu, 30 Sep 2021 23:50:49 -0700 Subject: [PATCH] Add steps for 03-01 --- 03_01.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 03_01.md diff --git a/03_01.md b/03_01.md new file mode 100644 index 0000000..bd3069f --- /dev/null +++ b/03_01.md @@ -0,0 +1,25 @@ +# Learning Jenkins, 03-01: Install Jenkins as a Container + +# Prerequisites +You will need to configure Maven as a global build tool. + +In the Jenkins web interface, go to: + +`Manage Jenkins` -> `Global Tool Configuration` -> `Maven installations` -> `Add Maven`. + +Give your Maven installation a name and check the option to `Install automatically`. + +# Setting up the Jenkins Job +Create a freestyle job and configure it as follows: + +1. Add a build step using `Invoke Top-Level Maven Target`. +2. For the goal, enter `package`. +3. Add a build step to run the compiled package: +- *FOR WINDOWS*: Use the `Execute Windows batch command` build step +- FOR macOS, Linux, and Docker: Use the `Execute shell` build step +4. Enter the following command: +``` +java -cp target/hello-1.0-SNAPSHOT.jar com.learningjenkins.App +``` +5. Save the job and start a build. +