From b1f3ade9145cf0136d62e04d2a3829c34774d032 Mon Sep 17 00:00:00 2001 From: kuldeep Date: Wed, 12 Jun 2024 18:47:33 +0530 Subject: [PATCH] Added workflow, docker-compose.yml for weaviate, and spring-boot project --- .github/workflows/maven.yml | 37 +++--- .idea/.gitignore | 3 + .idea/Blogs-Analyzer.iml | 11 ++ .idea/modules.xml | 8 ++ Blogs_Analyzer/.gitignore | 33 ++++++ Blogs_Analyzer/docker-compose.yml | 13 +++ Blogs_Analyzer/pom.xml | 109 ++++++++++++++++++ .../analyzer/BlogsAnalyzerApplication.java | 13 +++ .../src/main/resources/application.properties | 1 + .../BlogsAnalyzerApplicationTests.java | 13 +++ 10 files changed, 219 insertions(+), 22 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Blogs-Analyzer.iml create mode 100644 .idea/modules.xml create mode 100644 Blogs_Analyzer/.gitignore create mode 100644 Blogs_Analyzer/docker-compose.yml create mode 100644 Blogs_Analyzer/pom.xml create mode 100644 Blogs_Analyzer/src/main/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplication.java create mode 100644 Blogs_Analyzer/src/main/resources/application.properties create mode 100644 Blogs_Analyzer/src/test/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplicationTests.java diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9558e40..d41ba51 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,18 +1,12 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Java CI with Maven on: push: - branches: [ "main" ] + branches: + - '**' pull_request: - branches: [ "main" ] + branches: + - '**' jobs: build: @@ -20,16 +14,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B package --file pom.xml + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file Blogs_Analyzer/pom.xml + - name: SonarCloud Scan + run: mvn -B clean verify -Psonar --file Blogs_Analyzer/pom.xml - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Blogs-Analyzer.iml b/.idea/Blogs-Analyzer.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/.idea/Blogs-Analyzer.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..dda0114 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Blogs_Analyzer/.gitignore b/Blogs_Analyzer/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/Blogs_Analyzer/.gitignore @@ -0,0 +1,33 @@ +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/ diff --git a/Blogs_Analyzer/docker-compose.yml b/Blogs_Analyzer/docker-compose.yml new file mode 100644 index 0000000..e61e6c4 --- /dev/null +++ b/Blogs_Analyzer/docker-compose.yml @@ -0,0 +1,13 @@ +services: + weaviate: + image: cr.weaviate.io/semitechnologies/weaviate:1.25.3 + ports: + - 8080:8080 + - 50051:50051 + restart: on-failure:0 + environment: + QUERY_DEFAULTS_LIMIT: 25 + AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true' + PERSISTENCE_DATA_PATH: '/var/lib/weaviate' + DEFAULT_VECTORIZER_MODULE: 'none' + CLUSTER_HOSTNAME: 'node1' \ No newline at end of file diff --git a/Blogs_Analyzer/pom.xml b/Blogs_Analyzer/pom.xml new file mode 100644 index 0000000..c7ad041 --- /dev/null +++ b/Blogs_Analyzer/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.0 + + + com.nashtech + blogsAnalyzer + 0.0.1-SNAPSHOT + blogsAnalyzer + Blogs_Analyzer project for Spring Boot + + + 21 + 3.9.1.2184 + 0.8.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonarVersion} + + + org.jacoco + jacoco-maven-plugin + ${maven.jacoco.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + + + sonar + + false + + + + nashtech + https://sonarcloud.io + b47aeba29df2889126c736ee7012a5a490edc34a + ${sonarConfig} + target/coverage-reports/jacoco.exec + + **/*config*/**, + **/*Application.* + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${maven.sonar.version} + + + verify + + sonar + + + + + + + + + diff --git a/Blogs_Analyzer/src/main/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplication.java b/Blogs_Analyzer/src/main/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplication.java new file mode 100644 index 0000000..cba1e3e --- /dev/null +++ b/Blogs_Analyzer/src/main/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplication.java @@ -0,0 +1,13 @@ +package com.nashtech.blogs.analyzer; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class BlogsAnalyzerApplication { + + public static void main(String[] args) { + SpringApplication.run(BlogsAnalyzerApplication.class, args); + } + +} diff --git a/Blogs_Analyzer/src/main/resources/application.properties b/Blogs_Analyzer/src/main/resources/application.properties new file mode 100644 index 0000000..dae34f9 --- /dev/null +++ b/Blogs_Analyzer/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=blogsAnalyzer diff --git a/Blogs_Analyzer/src/test/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplicationTests.java b/Blogs_Analyzer/src/test/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplicationTests.java new file mode 100644 index 0000000..619ff00 --- /dev/null +++ b/Blogs_Analyzer/src/test/java/com/nashtech/blogs/analyzer/BlogsAnalyzerApplicationTests.java @@ -0,0 +1,13 @@ +package com.nashtech.blogs.analyzer; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class BlogsAnalyzerApplicationTests { + + @Test + void contextLoads() { + } + +}