Skip to content

A demonstration for passing user defined parameters to Jenkins Jobs

Notifications You must be signed in to change notification settings

BINPIPE/parametrized-job-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parametrized Jenkins Job Demonstration

Learning Resources for DevOps, SRE, Cloud & Engineering Management

BINPIPE Learn DevOps! BINPIPE

Takes user inputs parameters to select branch and environment (Run Via Jenkins Freestyle Job)

Follow the tutorial video to get the configuration done. Essentially, the following steps are to be followed:

  1. Define the github repo url/credentials in the Jenkins Freestyle Job.
  2. Check the "This project is parameterized" and enable Choice Parameter with valid choices ("Red" or "Blue" in this example.) the build phase select the shell script option and add the following:
#!/bin/bash
if [[ "${choice}" == "Red" ]]; then
mv html/index.red html/index.html
else
mv html/index.blue html/index.html
fi
  1. In the build phase select the shell script option and add the jenkins-cicd.sh script as below.
    chmod +x jenkins-cicd.sh
    bash jenkins-cicd.sh
    
  2. Save the job and execute the build. Follow the execution via console logs.

Open browser at http://IP-Address-of-Docker-Server:8888/ to view the website.

BINPIPE aims to simplify learning for those who are looking to make a foothold in the industry.
Write to me at nixgurus@gmail.com if you are looking for tailor-made training sessions.
For self-study resources look around in this repository, the Binpipe Blog and Youtube Channel.

📒 Maintainer: Prasanjit Singh | www.binpipe.org


License

About

A demonstration for passing user defined parameters to Jenkins Jobs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published