Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
ba0cdf1
Junit and Mock Test Cases
wahid-nur-dahlan Aug 17, 2017
ff63a82
Junit Test Cases for Models
wahid-nur-dahlan Aug 17, 2017
8847690
Junit Test Cases for Models
wahid-nur-dahlan Aug 17, 2017
6c4904d
adding ansible playbook in vprofile-project
wahid-nur-dahlan Aug 24, 2017
2eae1a7
updated vprofile.yml file for version change
wkhanvisualpathit Aug 24, 2017
5f45b41
adding DB dump
wahid-nur-dahlan Aug 28, 2017
62e2988
Merge branch 'vp-ansible' of https://github.com/wkhanvisualpathit/VPr…
wahid-nur-dahlan Aug 28, 2017
17f57b7
removing db.sql dump file
wahid-nur-dahlan Sep 14, 2017
17572c0
adding ansible playbook in vprofile-project
wahid-nur-dahlan Aug 24, 2017
8aa189c
updated vprofile.yml file for version change
wkhanvisualpathit Aug 24, 2017
fd1099e
adding DB dump
wahid-nur-dahlan Aug 28, 2017
a5ef338
removing db.sql dump file
wahid-nur-dahlan Sep 14, 2017
1a116c7
Merge branch 'master' of https://github.com/wkhanvisualpathit/VProfile
wahid-nur-dahlan Sep 14, 2017
781b7c2
Updated README.md file for dump mention
wkhanvisualpathit Sep 14, 2017
02ff6c2
updated pom.xml for change of version
wkhanvisualpathit Sep 25, 2017
ad26e65
change for artefact version
wahid-nur-dahlan Sep 26, 2017
8aa5db5
change for artefact version
wahid-nur-dahlan Sep 26, 2017
0132cb8
rabbitmq integration with vprofile
Dec 3, 2017
139832b
pom modification for jacoco-cover plugin
Dec 3, 2017
90d850f
modification to conf
Dec 4, 2017
350655f
modifiying controller for test failure
Dec 4, 2017
51fd1dd
remove the target directory
Dec 4, 2017
df7b65e
Some UI changes is added
Dec 7, 2017
0950619
Merge branch 'vp-memcached-rabbitmq' of https://github.com/wkhanvisua…
Dec 7, 2017
4f44238
changing mysqldump file
Dec 7, 2017
142b00e
elasticsearch basic Integration
wkhanvisualpathit Dec 20, 2017
1e2033b
updating pom for plugin
wkhanvisualpathit Dec 20, 2017
d63a869
removing error from plugin sectiion
wkhanvisualpathit Dec 25, 2017
b423dcd
removing rabbit mq validations
wkhanvisualpathit Dec 25, 2017
219523c
Changes for spelling connections
wkhanvisualpathit Jan 11, 2018
9fb7f29
removing old dump file
wkhanvisualpathit Jan 25, 2018
90c10d3
updating dump file
wkhanvisualpathit Jan 30, 2018
8a5151a
Jenkinsfile
Jul 3, 2018
40c530b
Added tomcat deploy playbook for Ubuntu
Jul 17, 2018
9133e00
Update repo name as variable
imranteli Jul 17, 2018
b73fd6a
Corrected Syntax Error
imranteli Jul 17, 2018
944e545
syn error
imranteli Jul 17, 2018
8d08b00
update
imranteli Jul 17, 2018
d99479c
co
imranteli Jul 17, 2018
09f6b20
Checked syntax
imranteli Jul 17, 2018
e037019
cp -r updated
imranteli Jul 17, 2018
4d6d044
Changed task name
imranteli Jul 17, 2018
d326e3c
Check condition before copy
imranteli Jul 19, 2018
895a435
changed title
imranteli Aug 31, 2018
31a8f3a
Included backup
imranteli Sep 1, 2018
5b5aea9
disabled firewall
devopshydclub Jan 27, 2019
923d0b5
Changed to V2
devopshydclub Jan 27, 2019
d25db79
Updated Jenkinsfile
Jan 27, 2019
b895762
Jenkinsfile
Jan 27, 2019
f97662b
Jenkinsfile copy artifact included
Jan 27, 2019
0f67180
Jenkinsfile copy artifact included for staging job
Jan 27, 2019
9ce7514
changed version 3
Feb 6, 2019
07609fb
changed artifact name
devopshydclub May 3, 2019
fa60703
artifact path changed
devopshydclub May 3, 2019
bfbebc1
Updated Ansible Playbook
May 3, 2019
3da244c
Updated playbook
May 3, 2019
65ed5df
Updated ansible templates
May 3, 2019
b81463b
updated tomcat url
May 3, 2019
91dcc6b
updated tomcat url
May 3, 2019
9715b0c
fixed playbook syntax error
May 3, 2019
9c0e349
become=yes
May 3, 2019
3109567
changeg tomcat8 to tomcat svc name
May 3, 2019
5c3af72
removed variables from application.j2 template
May 3, 2019
935fb6e
remote_src:yes
May 3, 2019
02075eb
artifact destination download dir changed
May 3, 2019
dec07a2
artifact destination download dir changed
May 3, 2019
753036a
update ubuntu 18
May 3, 2019
c005105
systax error fixed in systemd file
May 3, 2019
2807adb
update tomcat start scripts
May 3, 2019
8f666e3
Update tags deploy
devopshydclub May 4, 2019
81d5df5
test commit
May 17, 2019
bbee545
Versioned with v4
devopshydclub Jul 2, 2019
491ce0d
Updated with nexus creds vars
devopshydclub Aug 4, 2019
4c8db86
<csrf disabled="true"/>
devopshydclub Aug 22, 2019
9d24b44
Version 4.0 updated
devopshydclub Nov 13, 2019
badb1f6
Updated Version
devopshydclub Dec 6, 2019
c103922
testing git polling log
devopshydclub Feb 20, 2020
18bd909
fixed jenkinsfile
devopshydclub May 21, 2020
a6743bf
fixed jenkinsfile job names
devopshydclub May 21, 2020
c931fcd
Testing git polling
devopshydclub May 22, 2020
6322f2f
Revert "fixed jenkinsfile job names"
devopshydclub Jun 29, 2020
cf1a527
test git polling
devopshydclub Jul 8, 2020
8eee031
Updated jenkisnfile with nexus and sonar jobs
Jul 23, 2020
24214f6
Testing new Jenkinsfile
Jul 23, 2020
9e071fc
updated artifact version
devopshydclub Jul 27, 2020
9eb847d
updated ansible template names
Jul 29, 2020
62ae78a
Merge branch 'vp-rem' of https://github.com/devopshydclub/vprofile-re…
Jul 29, 2020
b5610ce
updated tomcat svc filename
Jul 29, 2020
37831f3
Updated app file
devopshydclub Jul 30, 2020
c87ab54
changed rmq details in application.properties file
devopshydclub Jul 30, 2020
cf5c473
testing git poll from jenkins
devopshydclub Aug 19, 2020
d226355
removed vproapp
devopshydclub Sep 23, 2020
50e1614
Commented application.properties file deployment section
devopshydclub Sep 23, 2020
6698dd1
userdata
Sep 30, 2020
bf56ce6
reverted to older branch
imran78688 Sep 30, 2020
fadd760
updating missing deps
imran78688 Sep 30, 2020
ced1ec5
Updated with sonar analysys
imran78688 Sep 30, 2020
73969cf
Testing autobuild trigger in jenkins
imran78688 Sep 30, 2020
ec33ab8
Fixed, Certificate verification failed error.
devopshydclub Oct 5, 2021
fcb0a5e
Jenkins Setup Script updated with new steps
devopshydclub Jan 23, 2022
366ed75
updated path
devopshydclub May 21, 2022
c73e03f
updated whitespaces
devopshydclub May 21, 2022
f75c1e2
whitespaces
devopshydclub May 21, 2022
a2fd246
Fixed variable name
devopshydclub Aug 20, 2022
b13d641
Updated jdk11 version
devopshydclub Sep 10, 2022
320bd50
jacoco version upgrade to 0.8.4
devopshydclub Jan 2, 2023
d55e0d3
Jacoco version change
devopshydclub Jan 2, 2023
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
121 changes: 121 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
pipeline {

agent any
/*
tools {
maven "maven3"
}
*/
environment {
NEXUS_VERSION = "nexus3"
NEXUS_PROTOCOL = "http"
NEXUS_URL = "172.31.40.209:8081"
NEXUS_REPOSITORY = "vprofile-release"
NEXUS_REPOGRP_ID = "vprofile-grp-repo"
NEXUS_CREDENTIAL_ID = "nexuslogin"
ARTVERSION = "${env.BUILD_ID}"
}

stages{

stage('BUILD'){
steps {
sh 'mvn clean install -DskipTests'
}
post {
success {
echo 'Now Archiving...'
archiveArtifacts artifacts: '**/target/*.war'
}
}
}

stage('UNIT TEST'){
steps {
sh 'mvn test'
}
}

stage('INTEGRATION TEST'){
steps {
sh 'mvn verify -DskipUnitTests'
}
}

stage ('CODE ANALYSIS WITH CHECKSTYLE'){
steps {
sh 'mvn checkstyle:checkstyle'
}
post {
success {
echo 'Generated Analysis Result'
}
}
}

stage('CODE ANALYSIS with SONARQUBE') {

environment {
scannerHome = tool 'sonarscanner4'
}

steps {
withSonarQubeEnv('sonar-pro') {
sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \
-Dsonar.projectName=vprofile-repo \
-Dsonar.projectVersion=1.0 \
-Dsonar.sources=src/ \
-Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \
-Dsonar.junit.reportsPath=target/surefire-reports/ \
-Dsonar.jacoco.reportsPath=target/jacoco.exec \
-Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml'''
}

timeout(time: 10, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}

stage("Publish to Nexus Repository Manager") {
steps {
script {
pom = readMavenPom file: "pom.xml";
filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
artifactPath = filesByGlob[0].path;
artifactExists = fileExists artifactPath;
if(artifactExists) {
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version} ARTVERSION";
nexusArtifactUploader(
nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL,
groupId: NEXUS_REPOGRP_ID,
version: ARTVERSION,
repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID,
artifacts: [
[artifactId: pom.artifactId,
classifier: '',
file: artifactPath,
type: pom.packaging],
[artifactId: pom.artifactId,
classifier: '',
file: "pom.xml",
type: "pom"]
]
);
}
else {
error "*** File: ${artifactPath}, could not be found";
}
}
}
}


}


}
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
## Prerequisites
####
### Prerequisites
- JDK 1.8 or later
- Maven 3 or later
- MySQL 5.6 or later

## Technologies
### Technologies
- Spring MVC
- Spring Security
- Spring Data JPA
- Maven
- JSP
- MySQL
## Database
### Database
Here,we used Mysql DB
MSQL DB Installation Steps for Linux ubuntu 14.04:
- $ sudo apt-get update
- $ sudo apt-get install mysql-server

Then look for the file :
- /src/main/resources/db.sql

- db.sql file contents all step for DB table creation commands.
- /src/main/resources/accountsdb
- accountsdb.sql file is a mysql dump file.we have to import this dump to mysql db server
- > mysql -u <user_name> -p accounts < accountsdb.sql


39 changes: 39 additions & 0 deletions ansible/vprofile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- hosts: tomcatservers
become: yes
gather_facts: False
tasks:

- name: Install EPEL-release
yum: name=epel-release state=present


- name: Install java_1.8
yum: name=java-1.8.0-openjdk.x86_64 state=present

- name: Install tomcat
yum: name=tomcat state=present


- name: Download latest VProfile.war file
get_url: url=http://{{nexusip}}:8081/nexus/content/repositories/VProfile-repo/{{groupid}}/{{time}}/{{build}}/{{vprofile_version}} dest=/tmp/ mode=755

- name: Stop tomcat service
service: name=tomcat state=stopped

- name: Copy artifact to tomcat folder
shell: cp /tmp/{{vprofile_version}} /var/lib/tomcat/webapps

- name: Delete link to existing vprofile version
file: path=/var/lib/tomcat/webapps/VProfile state=absent

- name: Start tomcat service
service: name=tomcat state=started
- wait_for: path=/var/lib/tomcat/webapps/{{time}}-{{build}}

- name: Link latest vprofile version
file: src=/var/lib/tomcat/webapps/{{time}}-{{build}} dest=/var/lib/tomcat/webapps/VProfile state=link

- name: Stop iptables
service: name=iptables state=stopped

22 changes: 16 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.visualpathit</groupId>
<artifactId>VProfile</artifactId>
<artifactId>vprofile</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<version>v2</version>
<name>Visualpathit VProfile Webapp</name>
<url>http://maven.apache.org</url>
<properties>
Expand Down Expand Up @@ -134,9 +134,14 @@
</plugin>
<!-- CODE COVERAGE -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<id>jacoco-initialize</id>
Expand All @@ -156,5 +161,10 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>${NEXUS-GRP-REPO}</id>
<url>http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/</url>
</repository>
</repositories>
</project>

38 changes: 38 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">

<servers>
<server>
<id>${SNAP-REPO}</id>
<username>${NEXUS-USER}</username>
<password>${NEXUS-PASS}</password>
</server>
<server>
<id>${RELEASE-REPO}</id>
<username>${NEXUS-USER}</username>
<password>${NEXUS-PASS}</password>
</server>
<server>
<id>${CENTRAL-REPO}</id>
<username>${NEXUS-USER}</username>
<password>${NEXUS-PASS}</password>
</server>
<server>
<id>${NEXUS-GRP-REPO}</id>
<username>${NEXUS-USER}</username>
<password>${NEXUS-PASS}</password>
</server>
</servers>

<mirrors>
<mirror>
<id>${CENTRAL-REPO}</id>
<name>${CENTRAL-REPO}</name>
<url>http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>

</settings>
104 changes: 104 additions & 0 deletions src/main/resources/accountsdb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64)
--
-- Host: localhost Database: accounts
-- ------------------------------------------------------
-- Server version 5.7.18-0ubuntu0.16.10.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `role`
--

DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role`
--

LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
INSERT INTO `role` VALUES (1,'ROLE_USER');
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`userEmail` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user`
--

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (4,'admin_vp','admin@visualpathit.com','$2a$11$DSEIKJNrgPjG.iCYUwErvOkREtC67mqzQ.ogkZbc/KOW1OPOpZfY6');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `user_role`
--

DROP TABLE IF EXISTS `user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_role` (
`user_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`role_id`),
KEY `fk_user_role_roleid_idx` (`role_id`),
CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user_role`
--

LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
INSERT INTO `user_role` VALUES (4,1);
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2017-08-28 10:50:51
Loading