Recover a Deleted Commit
- Commit 3 is deleted
- Check the reflog
- 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
- 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
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.
- 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
- 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
* Verify /etc/passwd on jenkins master
* 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
* 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
* java 11
git clone https://github.com/spring-projects/spring-petclinic.git
* Execute the build