List of commits:
Subject Hash Author Date (UTC)
Refactor build.gradle 0348a38a7bc46a35a466d59c3f67bbb0e430493d mandas04 2019-02-02 11:00:49
Updating code covergae ratio check to 90% 49684bdc879b14c55bd080a381827938fa44b56a mandas04 2019-02-01 10:36:37
[AP] Set jvm args to make builds faster 34c27cf2d35d97d82d06a6a675561843b389552b Pai, Ashwin 2019-02-01 10:05:55
Excluding models from code coverage reprot f22c7d1833e8c9a36057894195294c174334e03d mandas04 2019-02-01 09:37:57
Update sanity check URL for prod c499fd864c92cf5e01187270f3ab8bbfcc05faed mandas04 2019-02-01 04:48:11
[AP] Adding sanity test in dev & prod ceeabd906af4e2cf2266fa6429fb6a0cef916dce Pai, Ashwin 2019-01-31 20:14:35
[AP] Check runList exist before accessing it. 182194ab3988dbd0049005dc97be0cfbdbf16fd0 Pai, Ashwin 2019-01-31 17:34:03
[AP] Get runList var from the -P command line 5b6699ca61da8597ba3a7900ab0d14e1b9f35a44 Pai, Ashwin 2019-01-31 17:26:19
[AP] Fix the credential id for gitlab 9bba45b10eb93688e11435219a7cdffafbbee8d7 Pai, Ashwin 2019-01-31 17:18:45
Refactor Jenkins cred 36acd3adbb192d251ccdc83802fc6a54798d3493 mandas04 2019-01-31 15:55:35
Update test cases 351a1f00250e293ff49fd66c852a3bced9c296be mandas04 2019-01-31 15:21:06
Skipped testing during gradle build 37352f5b876e311a19a8b2aea5759c9c1be8f037 mandas04 2019-01-31 13:29:27
Adjust JaCoCo test coverage 3eca68000e279756223fc5d27accf3a12988ad1d mandas04 2019-01-31 13:17:55
update resttemplate configurations bd1da0c99a2f97c0f7ac1537121a093b7229cba5 mandas04 2019-01-31 13:10:04
Refactor test packages ddc3aae04e4ebceb21b5a421813be6e0cc7733ad mandas04 2019-01-31 11:46:57
Refactoring Test packages e916b5f3f15beb28f5a7373bc046cc81fb2b7630 mandas04 2019-01-31 04:36:10
Refactor DockerFile 90de083d4cb6128977b761994a02b244c8d3cf6c mandas04 2019-01-30 14:31:54
Refactor DockerFile cbf36a94f7e3d7cd6ca2c36279ec5d28886afc54 mandas04 2019-01-30 12:52:25
Liquibase setup for dev and prod separately 93cb8265755e2ceb14c45b1f99e8581aa93155fc mandas04 2019-01-30 12:41:48
Sanity test in dev: correct env variable name f0ecedb119b83f313b5a04e1affb4e1584790ce4 mandas04 2019-01-30 09:47:33
Commit 0348a38a7bc46a35a466d59c3f67bbb0e430493d - Refactor build.gradle
Author: mandas04
Author date (UTC): 2019-02-02 11:00
Committer name: mandas04
Committer date (UTC): 2019-02-02 11:10
Parent(s): afca208b44767315c3b6abfff2f6417fe0d396ce
Signing key:
Tree: 08b652ae94700bb61d51dce0d50cc83791f407a6
File Lines added Lines deleted
build.gradle 1 6
src/main/java/com/kingfisher/deployment/audit/model/Deployment.java 15 1
src/main/java/com/kingfisher/deployment/audit/repository/DeploymentRepository.java 12 1
src/main/java/com/kingfisher/deployment/audit/service/DeploymentAuditService.java 7 2
src/main/resources/application-dev.properties 0 3
src/main/resources/db/changelog-dev.xml 5 0
src/main/resources/db/changelog-prod.xml 5 0
src/main/resources/db/scripts/dev/001.SCHEMA_DEPLOYMENT.sql 3 1
src/main/resources/db/scripts/dev/001.SCHEMA_DEPLOYMENT_INDEX.sql 1 0
src/main/resources/db/scripts/prod/001.SCHEMA_DEPLOYMENT.sql 3 1
src/main/resources/db/scripts/prod/001.SCHEMA_DEPLOYMENT_INDEX.sql 1 0
File build.gradle changed (mode: 100644) (index 516b9e2..fbc3d84)
... ... buildscript {
21 21 classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
22 22 classpath 'com.oracle:ojdbc8:12.2.0.2' classpath 'com.oracle:ojdbc8:12.2.0.2'
23 23 classpath "org.liquibase:liquibase-gradle-plugin:1.1.1" classpath "org.liquibase:liquibase-gradle-plugin:1.1.1"
24 }
24 }
25 25 } }
26 26
27 27 apply plugin: 'java' apply plugin: 'java'
 
... ... jacocoTestCoverageVerification {
94 94 violationRules { violationRules {
95 95 rule { rule {
96 96 excludes = ['com.kingfisher.deployment.audit.model.*','com.kingfisher.deployment.audit.exception.model.*'] excludes = ['com.kingfisher.deployment.audit.model.*','com.kingfisher.deployment.audit.exception.model.*']
97 limit {
98 counter = 'LINE'
99 value = 'COVEREDRATIO'
100 minimum = 0.9
101 }
102 97 } }
103 98 } }
104 99 } }
File src/main/java/com/kingfisher/deployment/audit/model/Deployment.java changed (mode: 100644) (index 5f9bc15..7f7088a)
... ... public class Deployment {
61 61 @Column(name = "created_by_process") @Column(name = "created_by_process")
62 62 private String createdByProcess; private String createdByProcess;
63 63
64 @Column(name = "bar_deleted")
65 private boolean barDeleted;
66
67 @Column(name = "exclude_from_report")
68 private boolean excludeFromReport;
69
64 70 public Deployment() { public Deployment() {
65 71 } }
66 72
 
... ... public class Deployment {
192 198 this.createdByProcess = createdByProcess; this.createdByProcess = createdByProcess;
193 199 } }
194 200
201 public boolean isExcludeFromReport() {
202 return excludeFromReport;
203 }
204
205 public void setExcludeFromReport(boolean excludeFromReport) {
206 this.excludeFromReport = excludeFromReport;
207 }
208
195 209 @Override @Override
196 210 public String toString() { public String toString() {
197 return "Deployment [deploymentId=" + deploymentId + ", applicationName=" + applicationName + ", barfileName=" + barfileName + ", environment=" + environment + ", instanceName=" + instanceName + ", integrationServer=" + integrationServer + ", barDeploymentTime=" + barDeploymentTime + ", createdTime=" + createdTime + ", barModifyTime=" + barModifyTime + ", barReleaseId=" + barReleaseId + ", barChecksum=" + barChecksum + ", deployedByUserName=" + deployedByUserName + ", deployedByUserId=" + deployedByUserId + ", createdByProcess=" + createdByProcess + "]";
211 return "Deployment [deploymentId=" + deploymentId + ", applicationName=" + applicationName + ", barfileName=" + barfileName + ", environment=" + environment + ", instanceName=" + instanceName + ", integrationServer=" + integrationServer + ", barDeploymentTime=" + barDeploymentTime + ", createdTime=" + createdTime + ", barModifyTime=" + barModifyTime + ", barReleaseId=" + barReleaseId + ", barChecksum=" + barChecksum + ", deployedByUserName=" + deployedByUserName + ", deployedByUserId=" + deployedByUserId + ", createdByProcess=" + createdByProcess + ", barDeleted=" + barDeleted + ", excludeFromReport=" + excludeFromReport + "]";
198 212 } }
199 213
200 214 } }
File src/main/java/com/kingfisher/deployment/audit/repository/DeploymentRepository.java changed (mode: 100644) (index 139b650..1b18b67)
1 1 package com.kingfisher.deployment.audit.repository; package com.kingfisher.deployment.audit.repository;
2 2
3 import java.util.Date;
3 4 import java.util.List; import java.util.List;
5 import java.util.Optional;
4 6
5 7 import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
8 import org.springframework.data.jpa.repository.Modifying;
6 9 import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
7 10 import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
8 11 import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
12 import org.springframework.transaction.annotation.Transactional;
9 13
10 14 import com.kingfisher.deployment.audit.model.Deployment; import com.kingfisher.deployment.audit.model.Deployment;
11 15
12 16 @Repository @Repository
13 17 public interface DeploymentRepository extends JpaRepository<Deployment, Integer> { public interface DeploymentRepository extends JpaRepository<Deployment, Integer> {
14 18
15 @Query(value = "select d.* from (select max(created_time)max_created_time, instance_name ,integration_server from deployment where application_name=:app and environment=:env group by instance_name ,integration_server) p join (select * from deployment where application_name=:app and environment=:env) d on p.max_created_time=d.created_time and p.instance_name=d.instance_name and p.integration_server=d.integration_server order by d.integration_server", nativeQuery = true)
19 @Query(value = "select * from deployment where environment=:env and application_name=:app and exclude_from_report=0", nativeQuery = true)
16 20 List<Deployment> findLatestDeploymentByApplicationNameAndEnvironment(@Param("env") String env, @Param("app") String app); List<Deployment> findLatestDeploymentByApplicationNameAndEnvironment(@Param("env") String env, @Param("app") String app);
17 21
18 22 @Query(value = "select distinct application_name from deployment where environment in :envs", nativeQuery = true) @Query(value = "select distinct application_name from deployment where environment in :envs", nativeQuery = true)
19 23 List<String> findApplicationName(@Param("envs") List<String> environments); List<String> findApplicationName(@Param("envs") List<String> environments);
24
25 @Modifying(clearAutomatically = true)
26 @Transactional
27 @Query(value = "update deployment set exclude_from_report=1 where application_name=:applicationName and instance_name=:instanceName and integration_server=:integrationServer and exclude_from_report=0", nativeQuery = true)
28 int hideFromReport(@Param("applicationName") String applicationName, @Param("instanceName") String instanceName, @Param("integrationServer") String integrationServer);
29
30 Optional<Deployment> findByApplicationNameAndInstanceNameAndIntegrationServerAndBarDeploymentTime(String applicationName, String instanceName, String integrationServer, Date barDeploymentTime);
20 31 } }
File src/main/java/com/kingfisher/deployment/audit/service/DeploymentAuditService.java changed (mode: 100644) (index 8bfa94b..38a3c5c)
... ... import java.util.Date;
6 6 import java.util.LinkedHashMap; import java.util.LinkedHashMap;
7 7 import java.util.List; import java.util.List;
8 8 import java.util.Map; import java.util.Map;
9 import java.util.Optional;
10
9 11 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
10 12 import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
11 13
 
... ... public class DeploymentAuditService {
43 45 // Consolidate list of all environments considered for the report // Consolidate list of all environments considered for the report
44 46 List<String> environments = new ArrayList<>(reportingEnvs); List<String> environments = new ArrayList<>(reportingEnvs);
45 47 environments.add(referenceEnv); environments.add(referenceEnv);
46
48
47 49 List<String> applications = deploymentRepository.findApplicationName(environments); List<String> applications = deploymentRepository.findApplicationName(environments);
48 50 // deploymentRepository.findApplicationNameByEnvironment(referenceEnv); // deploymentRepository.findApplicationNameByEnvironment(referenceEnv);
49 51
 
... ... public class DeploymentAuditService {
82 84 List<Deployment> deployments = new ArrayList<>(); List<Deployment> deployments = new ArrayList<>();
83 85 for (JenkinsDeploymentStatus jenkinsDeploymentStatus : jenkinsDeploymentStatuses) { for (JenkinsDeploymentStatus jenkinsDeploymentStatus : jenkinsDeploymentStatuses) {
84 86 Deployment deployment = deploymentStatusBuidler.build(jenkinsDeploymentStatus); Deployment deployment = deploymentStatusBuidler.build(jenkinsDeploymentStatus);
85 deployments.add(deployment);
87 if (deploymentRepository.findByApplicationNameAndInstanceNameAndIntegrationServerAndBarDeploymentTime(deployment.getApplicationName(), deployment.getInstanceName(), deployment.getIntegrationServer(), deployment.getBarDeploymentTime()).equals(Optional.empty())) {
88 deploymentRepository.hideFromReport(deployment.getApplicationName(), deployment.getInstanceName(), deployment.getIntegrationServer());
89 deployments.add(deployment);
90 }
86 91 } }
87 92 deploymentRepository.saveAll(deployments); deploymentRepository.saveAll(deployments);
88 93 } }
File src/main/resources/application-dev.properties changed (mode: 100644) (index b48cc12..3639221)
... ... spring.jpa.properties.hibernate.jdbc.batch_size=50
13 13
14 14 liquibase.change.log.file=/src/main/resources/db/changelog-dev.xml liquibase.change.log.file=/src/main/resources/db/changelog-dev.xml
15 15
16 ssl.truststore.password=g+nTqtgAzbLZa9qJL5VeoA==
17 ssl.truststore.file=/src/main/resources/cert/truststore.jks
18
19 16 ssl.truststore.password=g+nTqtgAzbLZa9qJL5VeoA== ssl.truststore.password=g+nTqtgAzbLZa9qJL5VeoA==
20 17 ssl.truststore.file=truststore.jks ssl.truststore.file=truststore.jks
21 18
File src/main/resources/db/changelog-dev.xml changed (mode: 100644) (index c7d7435..3b80c53)
25 25 <sqlFile relativeToChangelogFile="true" <sqlFile relativeToChangelogFile="true"
26 26 path="scripts/dev/001.SCHEMA_DEPLOYMENT.sql" /> path="scripts/dev/001.SCHEMA_DEPLOYMENT.sql" />
27 27 </changeSet> </changeSet>
28 <changeSet id="001.SCHEMA_DEPLOYMENT_INDEX.sql" author="mandas04"
29 logicalFilePath="scripts/dev/001.SCHEMA_DEPLOYMENT_INDEX.sql">
30 <sqlFile relativeToChangelogFile="true"
31 path="scripts/dev/001.SCHEMA_DEPLOYMENT_INDEX.sql" />
32 </changeSet>
28 33
29 34 <changeSet id="001.INIT_USERS.sql" author="mandas04" <changeSet id="001.INIT_USERS.sql" author="mandas04"
30 35 logicalFilePath="scripts/dev/001.INIT_USERS.sql"> logicalFilePath="scripts/dev/001.INIT_USERS.sql">
File src/main/resources/db/changelog-prod.xml changed (mode: 100644) (index 7fde7c5..cf5e684)
25 25 <sqlFile relativeToChangelogFile="true" <sqlFile relativeToChangelogFile="true"
26 26 path="scripts/prod/001.SCHEMA_DEPLOYMENT.sql" /> path="scripts/prod/001.SCHEMA_DEPLOYMENT.sql" />
27 27 </changeSet> </changeSet>
28 <changeSet id="001.SCHEMA_DEPLOYMENT_INDEX.sql" author="mandas04"
29 logicalFilePath="scripts/prod/001.SCHEMA_DEPLOYMENT_INDEX.sql">
30 <sqlFile relativeToChangelogFile="true"
31 path="scripts/prod/001.SCHEMA_DEPLOYMENT_INDEX.sql" />
32 </changeSet>
28 33
29 34 <changeSet id="001.INIT_INSTANCE.sql" author="mandas04" <changeSet id="001.INIT_INSTANCE.sql" author="mandas04"
30 35 logicalFilePath="scripts/prod/001.INIT_INSTANCE.sql"> logicalFilePath="scripts/prod/001.INIT_INSTANCE.sql">
File src/main/resources/db/scripts/dev/001.SCHEMA_DEPLOYMENT.sql changed (mode: 100644) (index c489e59..9f76ab6)
... ... CREATE TABLE DEPLOYMENT (
13 13 INSTANCE_NAME VARCHAR2(255), INSTANCE_NAME VARCHAR2(255),
14 14 INTEGRATION_SERVER VARCHAR2(255), INTEGRATION_SERVER VARCHAR2(255),
15 15 BAR_MODIFY_TIME TIMESTAMP, BAR_MODIFY_TIME TIMESTAMP,
16 BAR_DELETED NUMBER(1,0) DEFAULT 0,
17 EXCLUDE_FROM_REPORT NUMBER(1,0) DEFAULT 0,
16 18 PRIMARY KEY (DEPLOYMENT_ID) PRIMARY KEY (DEPLOYMENT_ID)
17 )
19 )
File src/main/resources/db/scripts/dev/001.SCHEMA_DEPLOYMENT_INDEX.sql added (mode: 100644) (index 0000000..bc5b5cb)
1 CREATE INDEX index_deployment_hash on DEPLOYMENT(APPLICATION_NAME,INSTANCE_NAME,INTEGRATION_SERVER,BAR_DEPLOYMENT_TIME,EXCLUDE_FROM_REPORT)
File src/main/resources/db/scripts/prod/001.SCHEMA_DEPLOYMENT.sql changed (mode: 100644) (index c489e59..9f76ab6)
... ... CREATE TABLE DEPLOYMENT (
13 13 INSTANCE_NAME VARCHAR2(255), INSTANCE_NAME VARCHAR2(255),
14 14 INTEGRATION_SERVER VARCHAR2(255), INTEGRATION_SERVER VARCHAR2(255),
15 15 BAR_MODIFY_TIME TIMESTAMP, BAR_MODIFY_TIME TIMESTAMP,
16 BAR_DELETED NUMBER(1,0) DEFAULT 0,
17 EXCLUDE_FROM_REPORT NUMBER(1,0) DEFAULT 0,
16 18 PRIMARY KEY (DEPLOYMENT_ID) PRIMARY KEY (DEPLOYMENT_ID)
17 )
19 )
File src/main/resources/db/scripts/prod/001.SCHEMA_DEPLOYMENT_INDEX.sql added (mode: 100644) (index 0000000..bc5b5cb)
1 CREATE INDEX index_deployment_hash on DEPLOYMENT(APPLICATION_NAME,INSTANCE_NAME,INTEGRATION_SERVER,BAR_DEPLOYMENT_TIME,EXCLUDE_FROM_REPORT)
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Sumangal-IN/deployment-audit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Sumangal-IN/deployment-audit

Clone this repository using git:
git clone git://git.rocketgit.com/user/Sumangal-IN/deployment-audit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main