Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ script:
- ./gradlew build --stacktrace
- ./gradlew sonarqube --stacktrace

after_success:
- docker build -t speech4j/tenant-service -f Dockerfile .
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
- docker push speech4j/tenant-service

cache:
directories:
- '$HOME/.m2/repository'
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ docker run --name postgres-docker \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_USERNAME=postgres \
-e POSTGRES_DB=tenant_db \
-p 5432:5432 -d postgres
-p 5432:5432 -d tenant_db
```

## Running DB Migration
Expand Down
53 changes: 41 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id "org.liquibase.gradle" version "2.0.2"
id 'com.google.cloud.tools.jib' version '2.5.0'
}

group = 'com.speech4j'
Expand Down Expand Up @@ -38,27 +39,34 @@ diffChangeLog {

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'org.postgresql:postgresql'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
//JPA dependency for reducing of the boilerplate and making of the implementation of your persistence layer easier and faster.
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.projectlombok:lombok'
annotationProcessor "org.projectlombok:lombok"
//Spring-security-crypto dependency for encode passwords
implementation 'org.springframework.security:spring-security-crypto'
//Swagger dependency
implementation 'org.springdoc:springdoc-openapi-ui:1.3.0'
implementation 'org.liquibase:liquibase-core:3.8.9'
//Postgres dependency
runtimeOnly 'org.postgresql:postgresql'
//Json dependency for transferring credentials to db
implementation 'org.json:json:20190722'

//Lombok dependencies
implementation 'org.projectlombok:lombok'
annotationProcessor "org.projectlombok:lombok"
//Liquibase dependencies
implementation 'org.liquibase:liquibase-core:3.8.9'
liquibaseRuntime 'org.liquibase.ext:liquibase-hibernate5:3.8'
liquibaseRuntime sourceSets.main.runtimeClasspath
//Testing dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:postgresql'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}

liquibaseRuntime 'org.liquibase.ext:liquibase-hibernate5:3.8'
liquibaseRuntime sourceSets.main.runtimeClasspath
}

test {
Expand All @@ -81,11 +89,32 @@ jacocoTestReport {
csv.enabled false
}
}

project.tasks["sonarqube"].dependsOn "jacocoTestReport"


//===Liquibase configurations===
jib {
from {
image = 'openjdk:11'
}
to {
image = "speech4j/${name}"
tags = ['1.0.0', 'latest']
auth {
username = System.getenv('DOCKER_ID')
password = System.getenv('DOCKER_PASSWORD')
}
}
container {
jvmFlags = ['--enable-preview']
volumes = ["/tmp"]
}
}
tasks.build.dependsOn tasks.jib


/*
*===Liquibase configurations===
*/
Properties properties = new Properties()
Properties metadata = new Properties()
metadata.load(new FileInputStream("src/main/resources/liquibase-metadata.properties"))
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ services:
image: openjdk:11
ports:
- "8082:8080"
environment:
- DB_URL=jdbc:postgresql://db:5432/tenant_db
- DB_PASSWORD=postgres
- DB_USER=postgres
- AWS_SECRET_KEY=${AWS_SECRET_KEY}
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY}
- AWS_BUCKET_NAME=${AWS_BUCKET_NAME}
- AWS_ENDPOINT_URL=${AWS_ENDPOINT_URL}
volumes:
- ./build/libs:/tenant-service
command: ["java", "--enable-preview", "-jar", "/tenant-service/tenant-service-0.0.1-SNAPSHOT.jar"]
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ db:
spring:
datasource:
driver: org.postgresql.Driver
url: jdbc:postgresql://${db.host}:${db.port}/${db.name}
url: ${DB_URL:jdbc:postgresql://${db.host}:${db.port}/${db.name}}
username: ${DB_USERNAME:postgres}
password: ${DB_PASSWORD:postgres}
liquibase:
Expand Down