Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workshop: Build your own event store #36

Merged
merged 9 commits into from
Jan 14, 2025
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
57 changes: 57 additions & 0 deletions .github/workflows/workshops_build-your-own-event-store-solved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Workshop - Build your own event store - Solved

on:
# run it on push to the default repository branch
push:
branches: [main]
paths:
- "workshops/build-your-own-event-store/solved/**"
# run it during pull request
pull_request:
paths:
- "workshops/build-your-own-event-store/solved/**"

defaults:
run:
working-directory: workshops/build-your-own-event-store/solved

jobs:
build-and-test-code:
name: Build and test
runs-on: ubuntu-latest

strategy:
# define the test matrix
matrix:
java-version: [22]

steps:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Start containers
run: docker compose up -d

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: "adopt"
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
run: ./gradlew build

- name: Archive test report
uses: actions/upload-artifact@v4
if: always()
with:
name: Test report
path: ./workshops/build-your-own-event-store/solved/build/test-results/test

- name: Stop containers
if: always()
run: docker compose down
18 changes: 18 additions & 0 deletions workshops/build-your-own-event-store/solved/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.java]
max_line_length = 80

[*.md]
max_line_length = off
trim_trailing_whitespace = false
37 changes: 37 additions & 0 deletions workshops/build-your-own-event-store/solved/.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/
42 changes: 42 additions & 0 deletions workshops/build-your-own-event-store/solved/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'java'
}

group = 'io.event-driven'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
// Serialisation
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
implementation 'com.fasterxml.jackson.core:jackson-core:2.17.2'

// Postgres client
implementation 'org.postgresql:postgresql:42.7.3'

// Logging
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.23.1'

// Test frameworks
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
}

tasks.named('test') {
useJUnitPlatform {
excludeTags 'Exercise'
}
}

test {
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
}
31 changes: 31 additions & 0 deletions workshops/build-your-own-event-store/solved/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3"
services:
postgres:
image: postgres:17.2-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=postgres
networks:
- postgres

pgadmin:
image: dpage/pgadmin4
container_name: pgadmin_container
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres

networks:
postgres:
driver: bridge

volumes:
postgres:
pgadmin:
driver: local
Binary file not shown.
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.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading