Skip to content

Commit

Permalink
feat : initial commit of graphql query dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Nov 10, 2023
1 parent 798535c commit 83d857c
Show file tree
Hide file tree
Showing 80 changed files with 3,677 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
- boot-opensearch-sample/**/*
"component: httpclients":
- httpClients/web-client-webflux/**/*
- httpClients/http-proxy/**/*
- httpClients/rest-template/**/*
- httpClients/boot-http-proxy/**/*
- httpClients/boot-restclient/**/*
- httpClients/boot-rest-template/**/*
- httpClients/web-client-mvc/**/*
"status: waiting-for-triage":
- ./*
Expand Down Expand Up @@ -76,8 +77,9 @@
- boot-rabbitmq-thymeleaf/pom.xml
- boot-rest-docs-sample/pom.xml
- r2dbc/boot-jooq-r2dbc-sample/pom.xml
- httpClients/http-proxy/pom.xml
- httpClients/rest-template/pom.xml
- httpClients/boot-http-proxy/pom.xml
- httpClients/boot-restclient/pom.xml
- httpClients/boot-rest-template/pom.xml
- httpClients/web-client-webmvc/pom.xml
- httpClients/web-client-webflux/pom.xml
- open-api-spring-boot/pom.xml
39 changes: 39 additions & 0 deletions .github/workflows/graphql-boot-querydsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: boot-graphql-querydsl

on:
push:
paths:
- "graphql/boot-graphql-querydsl/**"
branches: [main]
pull_request:
paths:
- "graphql/boot-graphql-querydsl/**"
types:
- opened
- synchronize
- reopened

jobs:
build:
name: Run Unit & Integration Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: "graphql/boot-graphql-querydsl"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: "microsoft"
cache: "maven"

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Build and analyze
run: ./mvnw clean verify
43 changes: 43 additions & 0 deletions graphql/boot-graphql-querydsl/.github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI Build

on:
push:
branches:
- "**"

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '17' ]
steps:
- uses: actions/checkout@v3

- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'maven'

- name: Grant execute permission for mvnw
run: chmod +x mvnw

- name: Build with Maven
run: ./mvnw clean verify

- if: ${{ github.ref == 'refs/heads/main' }}
name: SonarQube Scan
run: ./mvnw compile sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ github.ref == 'refs/heads/main' }}
name: Build and Publish Docker Image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=${{ secrets.DOCKER_USERNAME }}/boot-graphql-querydsl
docker push ${{ secrets.DOCKER_USERNAME }}/boot-graphql-querydsl
37 changes: 37 additions & 0 deletions graphql/boot-graphql-querydsl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Misc ###
*.log
.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
13 changes: 13 additions & 0 deletions graphql/boot-graphql-querydsl/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"generator-springboot": {
"appName": "boot-graphql-querydsl",
"packageName": "com.example.graphql.querydsl",
"databaseType": "postgresql",
"dbMigrationTool": "liquibase",
"dbMigrationFormat": "xml",
"features": [],
"buildTool": "maven",
"packageFolder": "com/example/graphql/querydsl",
"liquibaseMigrationCounter": 4
}
}
14 changes: 14 additions & 0 deletions graphql/boot-graphql-querydsl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:17.0.9_9-jre-focal as builder
WORKDIR application
ARG JAR_FILE=target/boot-graphql-querydsl-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

# the second stage of our build will copy the extracted layers
FROM eclipse-temurin:17.0.9_9-jre-focal
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
19 changes: 19 additions & 0 deletions graphql/boot-graphql-querydsl/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pipeline {
agent any

triggers {
pollSCM('* * * * *')
}

environment {
APPLICATION_NAME = 'boot-graphql-querydsl'
}

stages {
stage('Build') {
steps {
sh './mvnw clean verify'
}
}
}
}
33 changes: 33 additions & 0 deletions graphql/boot-graphql-querydsl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# boot-graphql-querydsl

### Format code

```shell
$ ./mvnw spotless:apply
```

### Run tests

```shell
$ ./mvnw clean verify
```

### Run locally

```shell
$ docker-compose -f docker/docker-compose.yml up -d
$ ./mvnw spring-boot:run -Dspring-boot.run.profiles=local
```

### Using Testcontainers at Development Time
You can run `TestApplication.java` from your IDE directly.
You can also run the application using Maven as follows:

```shell
./mvnw spring-boot:test-run
```


### Useful Links
* Swagger UI: http://localhost:8080/swagger-ui.html
* Actuator Endpoint: http://localhost:8080/actuator
17 changes: 17 additions & 0 deletions graphql/boot-graphql-querydsl/docker/docker-compose-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'
services:

boot-graphql-querydsl:
build: ..
ports:
- "18080:8080"
- "18787:8787"
restart: always
depends_on:
- postgresqldb
environment:
- SPRING_PROFILES_ACTIVE=docker
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresqldb:5432/appdb
- SPRING_DATASOURCE_USERNAME=appuser
- SPRING_DATASOURCE_PASSWORD=secret
12 changes: 12 additions & 0 deletions graphql/boot-graphql-querydsl/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.8'
services:

postgresqldb:
image: postgres:16.0-alpine
environment:
- POSTGRES_USER=appuser
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=appdb
ports:
- "5432:5432"

1 change: 1 addition & 0 deletions graphql/boot-graphql-querydsl/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading

0 comments on commit 83d857c

Please sign in to comment.