Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Generate cookiecutter template from example project
on:
pull_request:
branches:
- main
paths:
- 'example/**'
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make script executable
run: chmod +x ./generate-cookiecutter-template-from-example-project.sh
- name: Generate cookiecutter template
run: ./generate-cookiecutter-template-from-example-project.sh
- name: Is there is difference in the generated template?
run: |
set -e
DIFF_OUTPUT=$(diff -qr example-tryout {{cookiecutter.app_name}} --exclude='.DS_Store' || true)
if [ -n "$DIFF_OUTPUT" ]; then
echo "$DIFF_OUTPUT"
echo "$DIFF_OUTPUT" > diff-output.txt
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Generate
name: Scaffold code from template
on:
pull_request:
branches: [ main ]
branches:
- main
paths:
- '{{cookiecutter.app_name}}/**'
workflow_dispatch:
jobs:
generate:
scaffold:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -31,4 +35,7 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: cd cart-service && mvn clean install -ntp
run: |
cd cart-service
mvn git-code-format:format-code
mvn clean install -ntp
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# IntelliJ project files
## IntelliJ project files
.idea
*.iml

# The default sample project
## Generated projects
# The generated project from scaffold-code-from-example.sh
example-tryout
# The generated project from cookiecutter
cart-service

## Build artifacts
target
7 changes: 7 additions & 0 deletions example/.docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcr.io/distroless/java21-debian12

WORKDIR /app

COPY ../../bootstrap/target/example-exec.jar .

CMD ["example-exec.jar"]
1 change: 1 addition & 0 deletions example/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @devs-from-matrix/app-generator-team
27 changes: 27 additions & 0 deletions example/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: ":bug: bug"
assignees: 'paul58914080, anupbaranwal'

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions example/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[New Feature]"
labels: ":rocket: enhancement"
assignees: 'paul58914080, anupbaranwal'

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions example/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Description

<!-- Description about this pull request -->

Closes : <!-- refer the github issue. Ex: #084-->

# Checklist:

- [ ] My code follows the contribution guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] My commits follow [conventional commit message guidelines](https://www.conventionalcommits.org/en/v1.0.0/)
10 changes: 10 additions & 0 deletions example/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "23:30"
open-pull-requests-limit: 10
assignees:
- paul58914080
29 changes: 29 additions & 0 deletions example/.github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean install -ntp
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions example/.mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
52 changes: 52 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# {{cookiecutter.app_title}}

## Pre-requisite

- maven >= 3.8.6
- open jdk 21

## How to build?

```
mvn clean install
```

### How to build a docker image?

```
cd bootstrap && mvn compile jib:dockerBuild
```

[More information](https://cloud.google.com/java/getting-started/jib)

## How to start ?

```
cd bootstrap && mvn spring-boot:run
```

## Formatting

This project uses [git-code-format-maven-plugin](https://github.com/Cosium/git-code-format-maven-plugin) for formatting
the code per [google style guide](https://google.github.io/styleguide/javaguide.html)

### How to format ?

`mvn git-code-format:format-code`

## Validating

This project
uses [githook-maven-plugin](https://mvnrepository.com/artifact/io.github.phillipuniverse/githook-maven-plugin) which is
a maven plugin to configure and install local git hooks by running set of commands during build.

### Command to validate formatted code

`mvn git-code-format:validate-code-format`

## Contribution guidelines

We are really glad you're reading this, because we need volunteer developers to help this project come to fruition.

Request you to please read
our [contribution guidelines](https://devs-from-matrix.github.io/basic-template-repository/#/README?id=contribution-guidelines)
144 changes: 144 additions & 0 deletions example/acceptance-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>group-id</groupId>
<artifactId>artifactName-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>acceptance-test</artifactId>
<dependencies>
<dependency>
<groupId>group-id</groupId>
<artifactId>bootstrap</artifactId>
</dependency>
<!-- Important: DO NOT DELETE the below dependencies though might seem like redundant to that of
bootstrap but they are required for jacoco and pitest report aggregation -->
<!-- left adapter -->
<dependency>
<groupId>group-id</groupId>
<artifactId>rest-adapter</artifactId>
</dependency>
<!-- domain -->
<dependency>
<groupId>group-id</groupId>
<artifactId>domain</artifactId>
</dependency>
<!-- right adapter -->
<dependency>
<groupId>group-id</groupId>
<artifactId>jpa-adapter</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Cucumber dependencies -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.cukedoctor</groupId>
<artifactId>cukedoctor-maven-plugin</artifactId>
<version>${cukedoctor-maven-plugin.version}</version>
<configuration>
<featuresDir>target/cucumber</featuresDir>
<outputFileName>Example</outputFileName>
<documentTitle>Example - Living Documentation</documentTitle>
<docVersion>${project.version}</docVersion>
<toc>center</toc>
</configuration>
<executions>
<execution>
<goals>
<goal>execute</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>aggregate-jacoco-reports</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.societegenerale.commons</groupId>
<artifactId>arch-unit-maven-plugin</artifactId>
<configuration>
<rules>
<preConfiguredRules>
<rule>com.societegenerale.commons.plugin.rules.NoJunitAssertRuleTest</rule>
<rule>com.societegenerale.commons.plugin.rules.NoPowerMockRuleTest</rule>
<rule>com.societegenerale.commons.plugin.rules.NoTestIgnoreRuleTest</rule>
<rule>com.societegenerale.commons.plugin.rules.NoTestIgnoreWithoutCommentRuleTest
</rule>
</preConfiguredRules>
</rules>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>mutation-test</id>
<activation>
<property>
<name>mutation.tests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest-maven-plugin.version}</version>
<executions>
<execution>
<id>aggregate-pitest-reports</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading