Creating freestyle project

Youtube link: Navigation for labs

Lab: In this lab we will create freestyle project from UI

  • On jenkins dashboard
    • New item
    • Enter a name, “myproj”
    • Select freestyle project
    • Press ok

 

  • In the build steps, go to execute shell, and paste below code
echo "job $JOB_NAME"
/usr/games/cowsay "Hello World"

  • Save it and click on Build now

  • Check the build history, and go for console output

Started by user admin
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/myproj
[myproj] $ /bin/sh -xe /tmp/jenkins4217804070361472141.sh
+ echo job myproj
job myproj
+ /usr/games/cowsay Hello World
/tmp/jenkins4217804070361472141.sh: 3: /usr/games/cowsay: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
  • Install cowsay on Jenkins master

apt install cowsay -y

  • Again build now, and check the latest build console output!! This time it will successful