PG DO - CI/CD Pipeline with Jenkins Simplilearn
- Step 1: Click on Launch Instance
- Step 2 : Click on Software Image (AMI)
- Select Ubuntu
- Step 4: Key pair name โ required
- Click on Create new key pair
- Put key pair name Jenkins-sl
- & Download it
- Step 5 : Click on Launch Instance
- Step 6 : Select your VM and Click connect
- Step 7 : You can see the terminal
- Step: Showing Github example
git --version
mkdir demo
cd demo
ssh-keygen
"Hit enter button 3 time"
cat ~/.ssh/id_rsa.pub
git clone [email protected]:manikcloud/Jenkins-cicd.git
history
history | cut -c 8-
sudo apt-get update -y && sudo apt install openjdk-8-jdk -y
sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update -y
sudo apt install jenkins -y
sudo /etc/init.d/jenkins start
sudo service jenkins status
sudo cat /home/labsuser/jenkins/secrets/initialAdminPassword
history | cut -c 8-
Replace x with your ip
- Select your instance
- Down below select your security tab
- Click on the Security groups sg-0c51908b5fa4abf75 (launch-wizard-2)
- Click on the action
- Click on EDIT INBOUND RULE
- Select custom TCP and put port 8080
- Custom ip should be 0.0.0.0/0
- Click on Save the rule
getting "E: Unable to locate package openjdk-8-jdk" message on java update
Run this command
sudo apt update -y
dashboard>manage>jenkins>manage plugins>maven integration
Java_Home
/usr/lib/jvm/java-8-openjdk-amd64/
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
echo "User First name is : $First_Name"
echo "User Last name is : $Last_Name"
echo "User Gender is : $Sex"
- https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
- https://maven.apache.org/download.cgi
Feature | Scripted Pipeline | Declarative Pipeline |
---|---|---|
Syntax | Groovy-based DSL | YAML-based DSL |
Structure | Procedural style, with stages defined as functions | Declarative style, with stages defined as steps |
Stage definition | Defined using stage step and block |
Defined using stages section and stage steps |
Parallel stages | Defined using parallel step and block |
Defined using parallel directive |
Agent definition | Defined using node step and block |
Defined using agent directive |
Environment variables | Defined using env map at the top of the script |
Defined using environment directive |
Post-build actions | Defined using post section |
Defined using post directive |
Flow control | Uses traditional if-else statements and loops |
Uses a declarative when directive for flow control |
Error handling | Uses try-catch-finally statements for error handling |
Uses catchError and error directives for error handling |
Shared libraries support | Supported | Supported |