Skip to content

Commit

Permalink
feat(book): Refactor for RESTfull service
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalijs <[email protected]>
  • Loading branch information
lvvorovi committed Sep 5, 2023
0 parents commit ae0c176
Show file tree
Hide file tree
Showing 55 changed files with 2,453 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/git-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: bookstore-job

on:
push:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build

- name: Build and Push Docker Image
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: lvvorovi/bookstore
tags: 2.0, 9
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
multiPlatform: true
platform: linux/amd64,linux/arm64
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:17-ea-16-jdk
ARG JAR_FILE=build/libs/*jar
COPY ./build/libs/nine-1.0.0.jar app.jar
ENTRYPOINT ["java", "-jar", "/app.jar"]

62 changes: 62 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.3'
id 'io.spring.dependency-management' version '1.1.3'
}


group = 'com.bookstore'
version = '1.0.0'

java {
sourceCompatibility = '17'
}

repositories {
mavenCentral()
}

ext {
set('springCloudVersion', "2022.0.4")
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

implementation 'org.springframework.cloud:spring-cloud-starter'

implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'

implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

runtimeOnly 'com.mysql:mysql-connector-j'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.h2database:h2:2.2.222'
testImplementation 'org.flywaydb:flyway-core'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation('it.ozimov:embedded-redis:0.7.3') {
exclude group: "org.slf4j"
}
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

tasks.named('test') {
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ae0c176

Please sign in to comment.