Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TestProjectProd124
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aray
TestProjectProd124
Commits
8f02b998
Commit
8f02b998
authored
Feb 23, 2023
by
aray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
743ebb0f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
109 additions
and
94 deletions
+109
-94
Dockerfile
Dockerfile
+6
-3
docker-compose.yml
docker-compose.yml
+10
-0
pom.xml
pom.xml
+11
-7
Default.java
src/main/java/com/altimetrik/ee/demo/controller/Default.java
+0
-4
PlaygroundAssessmentDemoApplication.java
...idate/assessment/PlaygroundAssessmentDemoApplication.java
+7
-6
SwaggerConfig.java
...playground/candidate/assessment/config/SwaggerConfig.java
+14
-19
AdminDbConsoleController.java
...idate/assessment/controller/AdminDbConsoleController.java
+41
-0
application.properties
src/main/resources/application.properties
+12
-0
application.yml
src/main/resources/application.yml
+8
-9
db-config-k8s.properties
src/main/resources/db-config-k8s.properties
+0
-0
validator.json
src/main/resources/validator.json
+0
-46
No files found.
Dockerfile
View file @
8f02b998
FROM
openjdk:8-jre-alpine
ADD
/target/demo-0.0.1-SNAPSHOT.jar //
ENTRYPOINT
["java", "-jar", "/demo-0.0.1-SNAPSHOT.jar"]
FROM
openjdk:8-alpine
ADD
/target/playground-assessment-demo-0.0.1-SNAPSHOT.jar //
ENTRYPOINT
["java", "-jar", "/playground-assessment-demo-0.0.1-SNAPSHOT.jar"]
docker-compose.yml
0 → 100644
View file @
8f02b998
version
:
'
3.3'
services
:
PlaygroundAssessmentDemo
:
image
:
playground-assessment-demo
container_name
:
playground-assessment-demo
build
:
.
ports
:
-
"
1099:1099"
\ No newline at end of file
pom.xml
View file @
8f02b998
...
...
@@ -9,23 +9,30 @@
<version>
2.0.5.RELEASE
</version>
<relativePath
/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.altimetrik
</groupId>
<artifactId>
demo
</artifactId>
<artifactId>
playground-assessment-
demo
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
articles
</name>
<description>
Demo project for Spring Boot
</description>
<name>
PlaygroundAssessmentDemo
</name>
<description>
PlaygroundAssessmentDemo
</description>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
...
...
@@ -41,10 +48,7 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- Swagger based Dependencies -->
<dependency>
<groupId>
io.swagger
</groupId>
...
...
src/main/java/com/altimetrik/ee/demo/controller/Default.java
deleted
100644 → 0
View file @
743ebb0f
package
com
.
altimetrik
.
ee
.
demo
.
controller
;
public
class
Default
{
}
src/main/java/com/altimetrik/Application.java
→
src/main/java/com/altimetrik/
playground/candidate/assessment/PlaygroundAssessmentDemo
Application.java
View file @
8f02b998
package
com
.
altimetrik
;
package
com
.
altimetrik
.
playground
.
candidate
.
assessment
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.scheduling.annotation.EnableAsync
;
@SpringBootApplication
@
EnableAsync
public
class
Application
{
@
Slf4j
public
class
PlaygroundAssessmentDemo
Application
{
public
static
void
main
(
String
[]
args
)
{
S
ystem
.
out
.
println
(
"App started...miami demo - day 2 Welcome to Articles Publishing Service."
);
SpringApplication
.
run
(
Application
.
class
,
args
);
S
pringApplication
.
run
(
PlaygroundAssessmentDemoApplication
.
class
,
args
);
log
.
info
(
"PlaygroundCandidateDemo app has been started successfully ..."
);
}
}
src/main/java/com/altimetrik/
ee/demo
/config/SwaggerConfig.java
→
src/main/java/com/altimetrik/
playground/candidate/assessment
/config/SwaggerConfig.java
View file @
8f02b998
package
com
.
altimetrik
.
ee
.
demo
.
config
;
package
com
.
altimetrik
.
playground
.
candidate
.
assessment
.
config
;
import
static
springfox
.
documentation
.
builders
.
PathSelectors
.
regex
;
import
java.util.Collections
;
...
...
@@ -14,30 +13,26 @@ import springfox.documentation.spi.DocumentationType;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
*
* @author MMelavanki
*
*/
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
// Production closes swagger
private
boolean
enableSwagger
=
true
;
@Bean
public
Docket
productApi
()
{
private
boolean
enableSwagger
=
true
;
@Bean
public
Docket
productApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
select
().
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.altimetrik.controllers"
)).
paths
(
regex
(
"/.*"
)).
build
()
.
enable
(
enableSwagger
).
apiInfo
(
metaData
());
}
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
select
().
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.altimetrik.controllers"
)).
paths
(
regex
(
"/.*"
)).
build
()
.
enable
(
enableSwagger
).
apiInfo
(
metaData
());
}
private
ApiInfo
metaData
()
{
private
ApiInfo
metaData
()
{
return
new
ApiInfo
(
"Playground Application
"
,
"Playground API Services"
,
"2.0"
,
"https://www.altimetrik.com/privacy-policy/"
,
new
Contact
(
"Playground"
,
"https://playground.altimetrik.com"
,
"pg-mgr1@altimetrik.com"
),
"Apache License Version 2.0"
,
"https://www.apache.org/licenses/LICENSE-2.0"
,
Collections
.
emptyList
());
}
return
new
ApiInfo
(
"Playground Candidate Assessment Demo
"
,
"Playground API Services"
,
"2.0"
,
"https://www.altimetrik.com/privacy-policy/"
,
new
Contact
(
"Playground"
,
"https://playground.altimetrik.com"
,
"pg-mgr1@altimetrik.com"
),
"Apache License Version 2.0"
,
"https://www.apache.org/licenses/LICENSE-2.0"
,
Collections
.
emptyList
());
}
}
src/main/java/com/altimetrik/playground/candidate/assessment/controller/AdminDbConsoleController.java
0 → 100644
View file @
8f02b998
package
com
.
altimetrik
.
playground
.
candidate
.
assessment
.
controller
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"/"
)
@CrossOrigin
public
class
AdminDbConsoleController
{
@Value
(
"${k8s.db.env}"
)
private
String
deploymentEnv
;
@GetMapping
(
value
=
"/"
,
produces
=
{
"text/html"
},
consumes
=
MediaType
.
ALL_VALUE
)
public
ResponseEntity
<
String
>
getUserDetailByGitlabEmailId
()
{
String
data
=
"Welcome to Playground Engineering Environment"
;
if
(
deploymentEnv
!=
null
&&
!
deploymentEnv
.
isEmpty
())
{
data
=
"<!DOCTYPE html>\n"
+
"<html>\n"
+
"<head>\n"
+
"<title>Playground Engineering Environment</title>\n"
+
"<style>\n"
+
"body {\n"
+
" background-color: white;\n"
+
" text-align: center;\n"
+
" color: black;\n"
+
"}\n"
+
"table {\n"
+
" align: center;\n"
+
" border-collapse: collapse;\n"
+
" width: 65%;\n"
+
"}\n"
+
"td, th {\n"
+
" border: 1px solid #dddddd;\n"
+
" padding: 8px;\n"
+
"}\n"
+
"tr:nth-child(even) {\n"
+
" background-color: #dddddd;\n"
+
"}\n"
+
"</style>\n"
+
"</head>\n"
+
"<body>\n"
+
"<img src='https://playground.altimetrik.com/assets/img/playground-logo2.svg' alt='Avatar' style='width:200px'>\n"
+
"<h2>Welcome to Playground Engineering Environment</h2>\n"
+
"<h3>Database access details</h3>\n"
+
"<table align=center>\n"
+
" <tr>\n"
+
" <th>DB Admin Console</th>\n"
+
" <th>JDBC URL</th>\n"
+
" <th>User Name</th>\n"
+
" <th>Password</th>\n"
+
" </tr>\n"
+
" <tr>\n"
+
" <td><a target='_blank' href='https://pgsandbox.altimetrik.com/project1457/project1457/'>https://pgsandbox.altimetrik.com/project1457/project1457/</a></td>\n"
+
" <td>jdbc:h2:file:./src/main/resources/project1457</td>\n"
+
" <td>playground</td>\n"
+
" <td>password</td>\n"
+
" </tr>\n"
+
"</table>\n"
+
"</body>\n"
+
"</html>\n"
;
}
return
new
ResponseEntity
<>(
data
,
HttpStatus
.
OK
);
}
}
src/main/resources/application.properties
View file @
8f02b998
spring.h2.console.enabled
=
true
spring.h2.console.settings.web-allow-others
=
true
spring.datasource.driverClassName
=
org.h2.Driver
spring.datasource.username
=
playground
spring.datasource.password
=
password
spring.jpa.database-platform
=
org.hibernate.dialect.H2Dialect
# temporary data storage
spring.datasource.url
=
jdbc:h2:file:./src/main/resources/test
k8s.db.env
=
server.servlet.contextPath
=
/
server.port
=
1099
\ No newline at end of file
src/main/resources/application.yml
View file @
8f02b998
# Spring properties
spring
:
application
:
name
:
PlaygroundCandidateDemo
# Service registers under this name
name
:
PlaygroundAssessmentDemo
freemarker
:
enabled
:
false
# Ignore Eureka dashboard FreeMarker templates
enabled
:
false
# HTTP Server
server
:
port
:
1099
# HTTP (Tomcat) port
servlet.contextPath
:
/
undertow
:
accesslog
:
undertow
:
accesslog
:
enabled
:
true
# Logging configurations
...
...
@@ -24,5 +22,7 @@ logging:
org.springframework.security
:
INFO
org.hibernate.SQL
:
WARN
article
:
fileName
:
validator.json
\ No newline at end of file
jasypt
:
encryptor
:
password
:
playground
src/main/resources/db-config-k8s.properties
deleted
100644 → 0
View file @
743ebb0f
src/main/resources/validator.json
deleted
100644 → 0
View file @
743ebb0f
[
{
"id"
:
1
,
"title"
:
"SAMPLE APPLICATION"
,
"description"
:
"It is a Sample Demo Application"
,
"tags"
:
[
"JAVA"
,
"SPRING"
],
"vote"
:
1
,
"createdBy"
:
"ssa3410@altimetrik.com"
,
"createdDate"
:
"01-12-2018"
,
"updatedBy"
:
null
,
"updatedDate"
:
null
},
{
"id"
:
2
,
"title"
:
"secod APPLICATION"
,
"description"
:
"It is a Sample Demo Application"
,
"tags"
:
[
"JAVA"
,
"SPRING"
],
"vote"
:
2
,
"createdDate"
:
"01-12-2018"
,
"createdBy"
:
"ssa3410@altimetrik.com"
,
"updatedDate"
:
null
,
"updatedBy"
:
null
},
{
"id"
:
3
,
"title"
:
"secod APPLICATION"
,
"description"
:
"It is a Sample Demo Application"
,
"tags"
:
[
"JAVA"
,
"SPRING"
],
"vote"
:
0
,
"createdDate"
:
"01-12-2018"
,
"createdBy"
:
"ssa3410@altimetrik.com"
,
"updatedDate"
:
null
,
"updatedBy"
:
null
}
]
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment