DevOps Classroomnotes 17/Sep/2022

Recover a Deleted Commit

  • Commit 3 is deleted
  • Check the reflog

Fork

  • This is a Git Server Repository Feature
  • Fork is used to create a local copy of the repository where you don’t have permissions.
  • Refer Here for the repository owned by someone else


Pull Request

  • Once you fork the repository and make changes, then pull request is a way so that we can send our local changes to the actual repository.
  • Actual Repository admin, can review you pull request and merge if required, reject if not.
  • Now we have create a fork and commited a change in the forked repository
  • Now lets create the pull request to send the changes for approval to the original repo owner

  • Now the actual repo owner recieves a pull request


CI/CD Pipeline

  • CI/CD Pipeline

Jenkins CI/CD Engine

  • Jenkins is a CI/CD Engine which can be used to create pipelines.
  • Jenkins is developed in JAVA language, so jenkins requires JAVA installation on the servers.
  • Jenkins is CRON (Scheduler) on Steriods developed for CI/CD Purposes.

Installing Jenkins

  • Lab Setup: Jenkins Master
  • For installing Jenkins Refer Here
  • For now lets create an ubuntu VM (free tier) & for installing refer here Refer Here
  • Ensure 22 and 8080 ports are open
  • Install java 11 (openjdk11)
# ubuntu
sudo apt-cache search openjdk
sudo apt install openjdk-11-jdk -y

#redhat
sudo yum search openjdk
  • Use the commands from the documentation
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
  • Now navigate to http://<public-ip>:8080
  • Now select install selected plugins


  • Now as discussed in the class create a free style jenkins project (job) with 2 commands in build steps => invoke shell
whoami
pwd


* Verify /etc/passwd on jenkins master

* Observations:
* A user with name jenkins and home directory /var/lib/jenkins got created.
* Jenkins UI is as good as linux user jenkins and the permissions which jenkins user has.
* Experiment 2:
* Lets execute sudo apt update in the build step along with whoami and pwd

* Add jenkins to the visudo with no password and rerun the build then it will work.
* Experiment 3:
* Lets build a java code spring pet clinic Refer Here
* Softwares required to perform build
* git
* java 11
* maven
* Commands
git clone https://github.com/spring-projects/spring-petclinic.git
cd spring-petclinic
mvn package


* Execute the build


*

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%