Skip to content

Commit 0045e47

Browse files
committed
feat(init): initial commit, create quarkus project and adds supporting files.
1 parent 3c9bbe0 commit 0045e47

File tree

19 files changed

+1106
-2
lines changed

19 files changed

+1106
-2
lines changed

.devcontainer/Containerfile.java21

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM mcr.microsoft.com/devcontainers/java:21
2+
3+
ENV DEBIAN_FRONTEND="noninteractive"
4+
ENV HOME="/root"
5+
ENV PATH="/opt/venv/bin:$PATH"
6+
ENV TESTCONTAINERS_RYUK_DISABLED true
7+
8+
WORKDIR /app
9+
10+
RUN apt update -y \
11+
&& apt -y install --no-install-recommends \
12+
curl \
13+
maven \
14+
python3-pip \
15+
python3-venv \
16+
docker.io \
17+
graphviz \
18+
postgresql-client \
19+
&& apt clean
20+
21+
RUN mkdir -p /opt/venv && \
22+
python3 -m venv /opt/venv && \
23+
/opt/venv/bin/pip install --upgrade pip && \
24+
/opt/venv/bin/pip install pre-commit
25+
26+
RUN curl -Ls https://sh.jbang.dev | bash -s - trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/ && \
27+
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
28+
29+
CMD ["sleep", "infinity"]

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "podmortem-log-parser",
3+
"build": {
4+
"dockerfile": "./Containerfile.java21"
5+
},
6+
"shutdownAction": "none",
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8+
"mounts": [
9+
"type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/root/.ssh,consistency=cached",
10+
"type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.m2,target=/root/.m2,consistency=cached"
11+
],
12+
"updateRemoteUserUID": true,
13+
"remoteUser": "root",
14+
"customizations": {
15+
"vscode": {
16+
"settings": {
17+
"chat.commandCenter.enabled": false,
18+
"editor.renderWhitespace": "all",
19+
"java.configuration.updateBuildConfiguration": "interactive",
20+
"java.project.sourcePaths": [
21+
"src/main/java",
22+
"src/test/java"
23+
]
24+
},
25+
"extensions": [
26+
"cweijan.vscode-database-client2",
27+
"ms-vscode.makefile-tools",
28+
"ms-azuretools.vscode-containers",
29+
"redhat.java",
30+
"redhat.vscode-quarkus",
31+
"redhat.vscode-yaml",
32+
"redhat.vscode-xml"
33+
]
34+
}
35+
}
36+
}

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!target/*-runner
3+
!target/*-runner.jar
4+
!target/lib/*
5+
!target/quarkus-app/*

.github/dependabot.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: 2
2+
registries:
3+
maven-github:
4+
type: maven-repository
5+
url: "https://maven.pkg.github.com"
6+
username: ${{github.actor}}
7+
password: ${{secrets.GH_PAT}}
8+
updates:
9+
- package-ecosystem: "maven"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
registries:
14+
- maven-github
15+
groups:
16+
maven-dependencies:
17+
patterns:
18+
- "*"
19+
20+
- package-ecosystem: "github-actions"
21+
directory: "/"
22+
schedule:
23+
interval: "daily"
24+
groups:
25+
github-actions-dependencies:
26+
patterns:
27+
- "*"
28+
29+
- package-ecosystem: "docker"
30+
directory: ".devcontainer/"
31+
schedule:
32+
interval: "daily"
33+
groups:
34+
docker-dependencies:
35+
patterns:
36+
- "*"
37+
38+
- package-ecosystem: "docker"
39+
directory: "src/main/docker/"
40+
schedule:
41+
interval: "daily"
42+
groups:
43+
docker-dependencies:
44+
patterns:
45+
- "*"

.github/workflows/build.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI for Native Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test-build:
13+
name: Test Build on Pull Request
14+
if: github.event_name == 'pull_request'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Build Docker image for testing
21+
uses: docker/build-push-action@v6
22+
with:
23+
context: .
24+
file: ./src/main/docker/Dockerfile.native
25+
push: false
26+
build-args: |
27+
GITHUB_USER=${{ github.actor }}
28+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
29+
30+
build-and-push:
31+
name: Build and Push on Main
32+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
33+
runs-on: ubuntu-latest
34+
permissions:
35+
contents: read
36+
packages: write
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Log in to the GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GH_PAT }}
48+
49+
- name: Build and push Docker image
50+
id: build-and-push
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: .
54+
file: ./src/main/docker/Dockerfile.native
55+
push: true
56+
tags: |
57+
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest
58+
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}
59+
build-args: |
60+
GITHUB_USER=${{ github.actor }}
61+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#Maven
2+
target/
3+
pom.xml.tag
4+
pom.xml.releaseBackup
5+
pom.xml.versionsBackup
6+
release.properties
7+
.flattened-pom.xml
8+
9+
# Eclipse
10+
.project
11+
.classpath
12+
.settings/
13+
bin/
14+
15+
# IntelliJ
16+
.idea
17+
*.ipr
18+
*.iml
19+
*.iws
20+
21+
# NetBeans
22+
nb-configuration.xml
23+
24+
# Visual Studio Code
25+
.vscode
26+
.factorypath
27+
28+
# OSX
29+
.DS_Store
30+
31+
# Vim
32+
*.swp
33+
*.swo
34+
35+
# patch
36+
*.orig
37+
*.rej
38+
39+
# Local environment
40+
.env
41+
42+
# Plugin directory
43+
/.quarkus/cli/plugins/
44+
# TLS Certificates
45+
.certs/

.mvn/wrapper/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
maven-wrapper.jar
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import java.io.IOException;
21+
import java.io.InputStream;
22+
import java.net.Authenticator;
23+
import java.net.PasswordAuthentication;
24+
import java.net.URI;
25+
import java.net.URL;
26+
import java.nio.file.Files;
27+
import java.nio.file.Path;
28+
import java.nio.file.Paths;
29+
import java.nio.file.StandardCopyOption;
30+
import java.util.concurrent.ThreadLocalRandom;
31+
32+
public final class MavenWrapperDownloader {
33+
private static final String WRAPPER_VERSION = "3.3.2";
34+
35+
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE"));
36+
37+
public static void main(String[] args) {
38+
log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION);
39+
40+
if (args.length != 2) {
41+
System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing");
42+
System.exit(1);
43+
}
44+
45+
try {
46+
log(" - Downloader started");
47+
final URL wrapperUrl = URI.create(args[0]).toURL();
48+
final String jarPath = args[1].replace("..", ""); // Sanitize path
49+
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize();
50+
downloadFileFromURL(wrapperUrl, wrapperJarPath);
51+
log("Done");
52+
} catch (IOException e) {
53+
System.err.println("- Error downloading: " + e.getMessage());
54+
if (VERBOSE) {
55+
e.printStackTrace();
56+
}
57+
System.exit(1);
58+
}
59+
}
60+
61+
private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath)
62+
throws IOException {
63+
log(" - Downloading to: " + wrapperJarPath);
64+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
65+
final String username = System.getenv("MVNW_USERNAME");
66+
final char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
67+
Authenticator.setDefault(new Authenticator() {
68+
@Override
69+
protected PasswordAuthentication getPasswordAuthentication() {
70+
return new PasswordAuthentication(username, password);
71+
}
72+
});
73+
}
74+
Path temp = wrapperJarPath
75+
.getParent()
76+
.resolve(wrapperJarPath.getFileName() + "."
77+
+ Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp");
78+
try (InputStream inStream = wrapperUrl.openStream()) {
79+
Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING);
80+
Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING);
81+
} finally {
82+
Files.deleteIfExists(temp);
83+
}
84+
log(" - Downloader complete");
85+
}
86+
87+
private static void log(String msg) {
88+
if (VERBOSE) {
89+
System.out.println(msg);
90+
}
91+
}
92+
93+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=source
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ci:
2+
autofix_prs: false
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.6.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: local
12+
hooks:
13+
- id: spotless
14+
name: spotless
15+
entry: mvn spotless:apply
16+
language: system
17+
files: \.java$
18+
stages: [pre-commit]

0 commit comments

Comments
 (0)