0% found this document useful (0 votes)
2 views

All_docs

The document provides a detailed guide on creating and managing Maven projects using GitHub, Jenkins, and Docker. It outlines step-by-step instructions for setting up Maven projects, configuring Jenkins pipelines, and using Docker for containerization. Additionally, it includes information on creating EC2 instances using AWS, though specific details on that section are not provided.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

All_docs

The document provides a detailed guide on creating and managing Maven projects using GitHub, Jenkins, and Docker. It outlines step-by-step instructions for setting up Maven projects, configuring Jenkins pipelines, and using Docker for containerization. Additionally, it includes information on creating EC2 instances using AWS, though specific details on that section are not provided.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 125

GIT EXERCISES

GITHUB EXERCISES
MAVEN JAVA PROJECT AND PUSHING IT TO GITHUB
Step 1) Go to file->new click maven project and write name and select archetype.
Step 2) Write Group and Artifact ID, wait till you get Build Success, then run as Maven Clean
Step 3) You will get Build Success, after that click Run as-> Maven Test and wait for Build success
Step 4) Now Select Run as -> Maven build and wait for Build Success, then again select

Run as-> Java Application


Step 5) Select Java Compiler and You will get your desired Output
Step 6) Open Git hub account and in new repository select Maven in GitIgnore, copy the url and
clone in local repository using Git Bash
Step 7) Copy the content to local cloned repository and add, commit the changes in Git bash,

Then push them to global repository

Refresh the Github to see the Updated repository.


Repository is successfully updated!!
CREATING MAVEN WEB PROJECT
Step 1: Open Eclipse IDE

Step 2: Click on New->Maven Project


Step 3: Click on Next->

Step 4: Enter in Filter Field: org.apache.maven.archetypes and click on Web app


Step 5: Enter Group ID && Artifact ID -> Click on Finish

Step 6: Wait Until Build Process is Completed.


Step 7: You can see your project on the left panel of the screen.

Step 8: Give right click on your project -> click on Run as -> Click on Maven Clean
Step 9: Give right click on your project -> click on Run as -> Click on Maven Install

Step 10: Give right click on your project -> click on Run as -> Click on Maven Test
Step 11: Give right click on your project -> click on Run as -> Click on Maven Build -> Write all the
steps What you did till now in Goals ->Apply -> Run

Step 12: Click on Servers -> There You find Tomcat Server if not Install it -> Initially it is in Stop Stage.
So, Right Click on it ->Click on Start
Step 13: Give right click on your project -> click on Run as -> Click on Run on the Server -> Select
Tomcat and Finish

Step 14: Done, you can see Your Web page on any default Browser
JENKINS 2 PIPELINE
Step 1: Go to Dashboard->New Item. Then enter project name as java_build, select free style project.

Then click on OK.

Step 2: In source code management select git and paste github repository where java project is
present.
Step 3: Check branch specifier is */main or not. If not update to */main.

Step 4: In build steps, click on Add build step and select “Invoke top-level maven targets”. In that
select maven version as MAVEN_HOME and enter goals as “clean install”.
Step 5: In post-build actions click on add post build actions and select “archieve the artifacts” and
enter files to archieve as “**/*”. Again, click on add post build actions and select “Build other
projects”. Then enter the project name as “java test” and then click on apply and save.

Step 6: Again, go to dashboard click on new item and project name as “java test” and select as
freestyle project. Then click on OK.
Step 7: In build environment select “delete workspace before build starts”.

Step 8: In build steps click on add build step and select “copy artifacts from other projects”.

Then in Artifacts to copy enter “**/*”.


Step 9: Again, click on add build step and select “Invoke top-level maven targets”. Then select maven
version as MAVEN_HOME and enter goals as “test” and then click on apply and save.

Step 10: Go to dashboard and click on new view.


Step 11: Give name and select “build pipeline view”. Click on create.

Step 12: In select initial job make sure that pipeline starts from “java build”.
Step 13: Click on run button.

JENKINS 3 PIPELINE
Step 1: Go to Dashboard->New Item. Then enter project name as mavenbuild, select freestyle
project. Then click on OK.

Step 2: In source code management select git and paste github repository where web project is
present.
Step 3: Check branch specifier is */main or not. If not update to */main.

Step 4: In build steps, click on Add build step and select “Invoke top-level maven targets”. In that
select maven version as MAVEN_HOME and enter goals as “clean install”.
Step 5: In post build actions click on add post build actions and select “archieve the srtifacts” and
enter files to archieve as “**/*”. Again, click on add post build actions and select “Build other
projects”. Then enter the project name as “maventest” and then click on apply and save.

Step 6: Again, go to dashboard click on new item and project name as “maventest” and select as
freestyle project. Then click on OK.
Step 7: In build environment select “delete workspace before build starts”.

Step 8: In build steps click on add build step and select “copy artifacts from other projects”.

Then in Artifacts to copy enter “**/*”.


Step 9: Again, click on add build step and select “Invoke top-level maven targets”. Then select maven
version as MAVEN_HOME and enter goals as “test” and then click on apply and save.

Step 10: In post-build actions click on add post build actions and select “archieve the srtifacts” and
enter files to archieve as “**/*”. Again, click on add post build actions and select “Build other
projects”. Then enter the project name as “mavendeploy” and then click on apply and save.
Step 11: Again, go to dashboard click on new item and project name as “mavendeploy” and select as
freestyle project. Then click on OK.

Step 12: In build steps click on add build step and select “copy artifacts from other projects”.

Then in Artifacts to copy enter “**/*”.


Step 13: In post-build actions click on add post build actions and select “deploy war/ear to a
container” and enter war/ear files as “**/*.war”, enter context path as webpath.

In containers select tomcat 9 and give tomcat url. Then click on apply and save.

Step 14: Go to dashboard and click on new view.


Step 15: Give name and select “build pipeline view”. Click on create.

Step 16: In select initial job make sure that pipeline starts from “mavenbuild”.
Step 17: Click on run button.

JENKINS SCRIPT PIPELINE


Step 1: Go to Dashboard->New Item. Then enter project name as script, select pipeline.

Then click on OK.

Step 2: Write the Jenkins script. Then click apply and save.
Step 3: Click on build now.

DOCKER SETUP AND CLI COMMANDS


`
DOCKER FILE
Step 1 : Create a new folder “docker-compose” on the desktop and open Git Bash.

Change directory to “docker-compose” by using cd command. Create sample docker file “app.js”
using vi command.
Step 2 : app.js is opened and statement is written, save and come back to git bash using :wq
command.

Step 3 : Create Dockerfile using vi command.

Step 4 : Getting base image from docker by entering our credentials.


Step 5 : Building docker image.
Step 6 : List of docker images created in docker.

Step 7 : Images in Docker Desktop.

Step 8 : By clicking on the run symbol on myimage -> Run a new container -> Select run.
Step 9 : Container is created.

Step 10 : List of containers in docker desktop.


Step 11 : Open Windows Powershell, display list of images.Tag the image to target image and push to
docker.

Step 12 : New tagged image is updated in Docker desktop.


Step 13 : The tagged image can be seen in docker hub in the browser by logging in.
DOCKER COMPOSE
KUBERNETES
NAGIOS
EC2 INSTANCE CREATION USING AWS

You might also like