Skip to content
Open
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
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM mcr.microsoft.com/devcontainers/java:1-17-bullseye

RUN mkdir /home/vscode/.m2 && \
chown -R vscode:vscode /home/vscode/.m2
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "doma-spring-boot",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
// Since the base image is Java 17, set the version to "none" so Java is not installed here.
// However, using SDKMAN! is convenient, so we still use ghcr.io/devcontainers/features/java.
"ghcr.io/devcontainers/features/java:1": {
"version": "none"
},
// For using Testcontainers.
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
// For using pre-commit.
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"toolsToInstall": "pre-commit"
}
},
"mounts": [
{
"source": "doma-spring-boot-maven",
"target": "/home/vscode/.m2",
"type": "volume"
},
{
"source": "doma-spring-boot-dind",
"target": "/var/lib/docker",
"type": "volume"
}
],
"postCreateCommand": ".devcontainer/setup.sh",
"customizations": {
"vscode": {
"extensions": [
"vmware.vscode-boot-dev-pack",
"redhat.vscode-xml",
"redhat.vscode-yaml"
]
}
}
}
2 changes: 2 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
pre-commit install -t pre-commit -t pre-push
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:

- repo: local
hooks:
- id: format
name: Format Java source code
entry: ./mvnw formatter:format -q
types:
- java
language: system
pass_filenames: false
stages:
- pre-commit

- repo: local
hooks:
- id: verify
name: Verify
entry: ./mvnw verify
language: system
pass_filenames: false
stages:
- pre-push