Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline project #3

Open
wants to merge 95 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
69d75c2
Update pom.xml
legah2045 Aug 27, 2020
04cf86e
Update pom.xml
legah2045 Aug 27, 2020
ef5c174
Add files via upload
legah2045 Aug 27, 2020
24a7125
Update home.jsp
legah2045 Aug 27, 2020
190a81b
Update home.jsp
legah2045 Aug 27, 2020
4d590e5
Update home.jsp
legah2045 Aug 27, 2020
30df3d7
Update home.jsp
legah2045 Aug 27, 2020
fe23acf
Update home.jsp
legah2045 Aug 27, 2020
16da8a6
Update home.jsp
legah2045 Aug 27, 2020
b346424
Update home.jsp
legah2045 Aug 27, 2020
f1133f5
Update home.jsp
legah2045 Aug 27, 2020
149d0b8
Add files via upload
legah2045 Aug 27, 2020
14463d0
Update home.jsp
legah2045 Aug 27, 2020
fa53f69
Update home.jsp
legah2045 Aug 27, 2020
8fba47d
Add files via upload
legah2045 Aug 27, 2020
9041c49
Update home.jsp
legah2045 Aug 27, 2020
5f3f53f
Update home.jsp
legah2045 Aug 28, 2020
f62576a
Update pom.xml
legah2045 Aug 29, 2020
8247dde
Update pom.xml
legah2045 Aug 29, 2020
962bb00
Update home.jsp
legah2045 Aug 29, 2020
20ac266
Update home.jsp
legah2045 Aug 29, 2020
8bce5c0
Update home.jsp
legah2045 Aug 29, 2020
723aa2d
Update home.jsp
legah2045 Aug 29, 2020
add3f64
Update home.jsp
legah2045 Aug 29, 2020
f4a6ea2
Merge pull request #2 from LandmakTechnology/master
legah2045 Aug 29, 2020
42c3dff
Merge pull request #3 from LandmakTechnology/development
legah2045 Aug 29, 2020
cf18bcd
Update pom.xml
legah2045 Aug 29, 2020
749e49a
Update home.jsp
legah2045 Aug 29, 2020
9d1c197
Create Jenkinsfile
legah2045 Sep 1, 2020
f6aadf8
Update Jenkinsfile
legah2045 Sep 1, 2020
22187d6
Create Jenkinsfile1
legah2045 Sep 1, 2020
757474f
Merge branch 'UAT' into master
legah2045 Sep 1, 2020
3dd5258
Merge pull request #4 from LandmakTechnology/master
legah2045 Sep 1, 2020
f22e207
Merge pull request #5 from LandmakTechnology/master
legah2045 Sep 1, 2020
e47cf6c
Merge pull request #6 from LandmakTechnology/UAT
legah2045 Sep 1, 2020
84ad95d
Merge pull request #7 from LandmakTechnology/development
legah2045 Sep 1, 2020
e82aa76
Update pom.xml
legah2045 Sep 2, 2020
f1f4a36
Create Jenkinsfile2
legah2045 Sep 2, 2020
5c927a0
Update home.jsp
legah2045 Sep 2, 2020
ffd2a5d
Update home.jsp
legah2045 Sep 2, 2020
58809eb
Update pom.xml
legah2045 Sep 2, 2020
960202d
Update Jenkinsfile
legah2045 Sep 2, 2020
2abf5b2
Update Jenkinsfile
legah2045 Sep 2, 2020
486dad9
Update Jenkinsfile
legah2045 Sep 2, 2020
a1a1e5e
Update Jenkinsfile
legah2045 Sep 2, 2020
b40b246
Update Jenkinsfile
legah2045 Sep 2, 2020
cb77c75
Update Jenkinsfile
legah2045 Sep 2, 2020
b667bac
Update Jenkinsfile
legah2045 Sep 2, 2020
b8d5007
Update home.jsp
legah2045 Sep 3, 2020
6477c78
Update home.jsp
legah2045 Sep 3, 2020
3e3e3ff
Update home.jsp
legah2045 Sep 4, 2020
51ddef4
Merge pull request #10 from LandmakTechnology/master
legah2045 Sep 5, 2020
c227822
Create Dockerfile
legah2045 Sep 10, 2020
be46b59
Update Dockerfile
legah2045 Sep 12, 2020
7d9b509
Update Dockerfile
legah2045 Sep 12, 2020
b3e4897
Update pom.xml
legah2045 Sep 16, 2020
ccf3024
Update pom.xml
legah2045 Sep 16, 2020
4cac791
Update pom.xml
legah2045 Sep 17, 2020
3fc6cf4
Update pom.xml
legah2045 Nov 14, 2020
decd0dd
Update pom.xml
legah2045 Nov 14, 2020
6d6d596
Update pom.xml
legah2045 Nov 14, 2020
82a8441
Update pom.xml
legah2045 Nov 14, 2020
e259ce3
Update pom.xml
legah2045 Nov 15, 2020
a99cde8
Update home.jsp
legah2045 Nov 15, 2020
858d1e5
Update Dockerfile
legah2045 Nov 15, 2020
3a6b4d2
Update pom.xml
legah2045 Nov 20, 2020
59f5c64
Update pom.xml
legah2045 Nov 20, 2020
15f1d52
Update pom.xml
legah2045 Nov 20, 2020
39240e6
Update pom.xml
legah2045 Nov 20, 2020
85ab4c6
Update pom.xml
legah2045 Nov 20, 2020
c88ace9
Merge branch 'master' into development
legah2045 Nov 21, 2020
1a8e0b5
Merge pull request #12 from LandmakTechnology/development
legah2045 Nov 21, 2020
5b82ef4
Update Jenkinsfile
legah2045 Nov 21, 2020
f4e28b1
Merge pull request #14 from LandmakTechnology/uat
legah2045 Nov 21, 2020
033a446
Update Jenkinsfile
legah2045 Nov 21, 2020
bdd0ecc
Merge pull request #15 from LandmakTechnology/feature
legah2045 Nov 21, 2020
4095c0a
Update Jenkinsfile
legah2045 Nov 21, 2020
e3c56fc
Merge pull request #16 from LandmakTechnology/bug_fix
legah2045 Nov 21, 2020
a7e0fea
Update pom.xml
legah2045 Nov 22, 2020
99f0397
Add files via upload
legah2045 Nov 28, 2020
61829b4
Update install_apache_dockerfile.txt
legah2045 Nov 28, 2020
2fc5acb
Create ansible-setup
legah2045 Nov 29, 2020
6c6b550
Update ansible-setup
legah2045 Nov 29, 2020
50cad07
Create docker-installation
legah2045 Nov 29, 2020
8e16951
Update ansible-setup
legah2045 Nov 29, 2020
6ad5405
Update pom.xml
legah2045 Feb 20, 2021
479f803
Update Jenkinsfile2
legah2045 Feb 23, 2021
8e6ea06
Update Jenkinsfile
legah2045 Feb 28, 2021
7c519b5
Update Jenkinsfile
legah2045 Feb 28, 2021
d92298f
Update Jenkinsfile
legah2045 Feb 28, 2021
3c17ce1
bts completed
abdullahHamdy Aug 18, 2021
4c6f55a
Merge pull request #20 from LandmakTechnology/feature-BTS-2021
legah2045 Aug 18, 2021
6a0ee13
Removing bugs
legah2045 Aug 18, 2021
5c8c343
Merge pull request #21 from LandmakTechnology/bug_fix-2021-11457
legah2045 Aug 18, 2021
aafd10c
test package
legendmbah Dec 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Docker/DockerHub.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## What is Docker Hub Registry

Docker Hub is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts. It provides a centralized resource for container image discovery, distribution and change management, user and team collaboration, and workflow automation throughout the development pipeline.

##### Ref URL : https://docs.docker.com/docker-hub/

1. Create a docker hub account in https://hub.docker.com/

1. Pull a docker image

```sh
docker pull ubuntu
```

1. pull a docker image with the old version

```sh
docker pull ubuntu:16.04
```

1. create a custom tag to the docker image
```sh
docker tag ubuntu:latest valaxy/ubuntu:demo
```

1. login to your docker hub registry
```sh
docker login
docker push valaxy/ubuntu:demo
```

### testing

1. Remove all images in docker server
```sh
docker image rm -f <Image_id>
```

1. Pull your custom image from your docker account
```sh
docker pull valaxy/ubuntu:demo
```

67 changes: 67 additions & 0 deletions Docker/Docker_Commands.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

1. how to search a docker image in hub.docker.com
```sh
docker search httpd
```
2. Download a docker image from hub.docker.com
```sh
docker image pull <image_name>:<image_version/tag>
```

3. List out docker images from your local system
```sh
docker image ls
```

4. Create/run/start a docker container from image
```sh
docker run -d --name <container_Name> <image_name>:<image_version/tag>

d - run your container in back ground (detached)
```

5. Expose your application to host server
```sh
docker run -d -p <host_port>:<container_port> --name <container_Name> <image_name>:<Image_version/tag>

docker run -d --name httpd_server -p 8080:80 httpd:2.2
```

6. List out running containers
```sh
docker ps
```

7. List out all docker container (running, stpooed, terminated, etc...)
```sh
docker ps -a
```

8. run a OS based container which interactive mode (nothing but login to container after it is up and running)

```sh
docker run -i -t --name centos_server centos:latest
i - interactive
t - Terminal
```

9. Stop a container
```sh
docker stop <container_id>
```

10. Start a container which is in stopped or exit state

```sh
docker start <container_id>
```
11. Remove a container

```sh
docker rm <container_id>
```

12. login to a docker container
```sh
docker exec -it <container_Name> /bin/bash
```
72 changes: 72 additions & 0 deletions Docker/Docker_Installation_Steps.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Installing Docker on Amazon Linux server

### Pre-requisites
1. Amazon Linux EC2 Instance

## Installation Steps

1. Install docker and start docker services
```sh
yum install docker -y
docker --version

# start docker services
service docker start
service docker status
```
1. Create a user called dockeradmin
```sh
useradd dockeradmin
passwd dockeradmin
```
1. add a user to docker group to manage docker
```
usermod -aG docker dockeradmin
```
### Validation test
1. Create a tomcat docker container by pulling a docker image from the public docker registry
```sh
docker run -d --name test-tomcat-server -p 8090:8080 tomcat:latest
```

## Docker Installation on CentOS server
##### Referance URL : https://docs.docker.com/install/linux/docker-ce/centos/#install-using-the-repository
### Pre-requisites

Please follow below steps to install docker CE on CentoOS server instance. For RedHat only Docker EE available

1. Install the required packages.

```sh
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
```

1. Use the following command to set up the stable repository.

```sh
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
```

### INSTALLING DOCKER CE

1. Install the latest version of Docker CE.
```sh
sudo yum install docker-ce
```

Note: If prompted to accept the GPG key, verify that the fingerprint matches
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.

1. Start Docker.
```sh
sudo systemctl start docker
```

1. Verify that docker is installed correctly by running the hello-world image.
```sh
sudo docker run hello-world
```
23 changes: 23 additions & 0 deletions Docker/install_apache_dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:12.04

MAINTAINER Landmark Technologies

LABEL version="1.1.0" \
app_name="Training registration application" \
release_date="9-Sep-2018"
RUN apt-get update && apt-get install -y apache2 && apt-get clean

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2

EXPOSE 80

COPY index.html /var/www/html
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]






5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM tomcat:9.0.37-jdk8
# removing bug from the applications.
# fixing vulnerability issues
# Dummy text to test #
COPY target/*.war /usr/local/tomcat/webapps/maven-web-app.war
43 changes: 43 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//Jenkins pipeline script
//Groovy script
node
{
def mavenHome = tool name: 'maven3.6.3'
stage('1. CodeClone')
{
git credentialsId: 'Github_credentials', url: 'https://github.com/myLandmakTechnology/maven-web-app.git'
}
stage('2. Build')
{
sh "${mavenHome}/bin/mvn package"
}

stage('3. CodeQuality')
{
//sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4.UploadNexus')
{
//sh "${mavenHome}/bin/mvn deploy"
}
stage('5. Approval')
{
echo "Approved. Ready for deployment"
}
stage('6. DeployTomcat')
{
//deploy adapters: [tomcat9(credentialsId: 'Tomcat-Credentials', path: '', url: 'http://54.163.156.108:8888/')], contextPath: null, war: 'target/*war'
}
stage('7. Notification')
{
//emailextrecipients([developers()])
}
}

//
/*
the
this
they
*/

52 changes: 52 additions & 0 deletions Jenkinsfile1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
node
{

def mavenHome = tool name: "maven3.6.2"

echo "GitHub BranhName ${env.BRANCH_NAME}"
echo "Jenkins Job Number ${env.BUILD_NUMBER}"
echo "Jenkins Node Name ${env.NODE_NAME}"

echo "Jenkins Home ${env.JENKINS_HOME}"
echo "Jenkins URL ${env.JENKINS_URL}"
echo "JOB Name ${env.JOB_NAME}"

properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')), pipelineTriggers([pollSCM('* * * * *')])])

stage("CheckOutCodeGit")
{
git url: 'https://github.com/LandmakTechnology/maven-web-app'
}

stage("Build")
{
sh "${mavenHome}/bin/mvn clean package"
}

/*
stage("ExecuteSonarQubeReport")
{
sh "${mavenHome}/bin/mvn sonar:sonar"
}

stage("UploadArtifactsintoNexus")
{
sh "${mavenHome}/bin/mvn deploy"
}

stage("DeployAppTomcat")
{
sshagent(['423b5b58-c0a3-42aa-af6e-f0affe1bad0c']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.34/webapps/"
}
}

stage('EmailNotification')
{
mail bcc: '[email protected]', body: '''Build is over
Thanks,
Landmark Technologies,
+14372152483.''', cc: '[email protected]', from: '', replyTo: '', subject: 'Build is over!!', to: '[email protected]'
}
*/
}
38 changes: 38 additions & 0 deletions Jenkinsfile2
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
node
{
def mavenHome = tool name: "maven3.6.3"

stage("1. git clone")
{
git credentialsId: 'gitCredentials', url: 'https://github.com/LandmakTechnology/maven-web-app.git'
}

stage("2. Build")
{
sh "${mavenHome}/bin/mvn clean package"

// bat mvn clean package - for winows OS
}
stage('3. Sonar')
{
//sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4. Nexus')
{
//sh "${mavenHome}/bin/mvn deploy"
}
stage('5. Deploy')
{
deploy adapters: [tomcat9(credentialsId: 'Tomcat-Credentials', path: '', url: 'http://54.163.156.108:8888/')], contextPath: null, war: 'target/*war'
}

stage('6. Email Notification')
{

emailext body: '''Hi

Build Status
Landmark Technology
+ 1 437 215 2483''', recipientProviders: [developers()], subject: 'Build status', to: '[email protected]'
}
}
Loading