Skip to content

Commit

Permalink
Add jhipster demo and pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
DoPaNik committed Dec 9, 2023
1 parent 8319208 commit 99cc15b
Show file tree
Hide file tree
Showing 498 changed files with 59,251 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/jhipsterCiCd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: JHipster CI/CD Pipeline
on: [push, pull_request]
jobs:
pipeline:
name: app pipeline
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]')"
timeout-minutes: 40
env:
NODE_VERSION: 18.18.2
SPRING_OUTPUT_ANSI_ENABLED: DETECT
SPRING_JPA_SHOW_SQL: false
JHI_DISABLE_WEBPACK_LOGS: true
NG_CLI_ANALYTICS: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.18.2
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Install node.js packages
run: npm install
working-directory: ./2_supplychain/2_praxis/DemoContainerSecurity/Demo/app
- name: Run backend test
run: |
chmod +x mvnw
npm run ci:backend:test
working-directory: ./2_supplychain/2_praxis/DemoContainerSecurity/Demo/app
- name: Run frontend test
run: npm run ci:frontend:test
working-directory: ./2_supplychain/2_praxis/DemoContainerSecurity/Demo/app
- name: Package application
run: npm run java:jar:prod
working-directory: ./2_supplychain/2_praxis/DemoContainerSecurity/Demo/app
- name: Build and publish docker image
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
GIT_TAG=:${GITHUB_REF#refs/tags/}
DOCKER_TAG=${GIT_TAG#:refs/heads/main}
./mvnw -ntp jib:build -Djib.to.image=jhipster/undefined${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}" -Pprod
working-directory: ./2_supplychain/2_praxis/DemoContainerSecurity/Demo/app

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile

# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 17, 17-bullseye, 17-buster
ARG VARIANT="17"
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}

# [Option] Install Maven
ARG INSTALL_MAVEN="false"
ARG MAVEN_VERSION=""
# [Option] Install Gradle
ARG INSTALL_GRADLE="false"
ARG GRADLE_VERSION=""
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java
{
"name": "App",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 17, 19
// Append -bullseye or -buster to pin to an OS version.
// Use the -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "17-bullseye",
// Options
// maven and gradle wrappers are used by default, we don't need them installed globally
// "INSTALL_MAVEN": "true",
// "INSTALL_GRADLE": "false",
"NODE_VERSION": "18.18.2"
}
},

"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"java.jdt.ls.java.home": "/docker-java-home"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"angular.ng-template",
"christian-kohler.npm-intellisense",
"firsttris.vscode-jest-runner",
"ms-vscode.vscode-typescript-tslint-plugin",
"dbaeumer.vscode-eslint",
"vscjava.vscode-java-pack",
"pivotal.vscode-boot-dev-pack",
"esbenp.prettier-vscode"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [4200, 3001, 9000, 8080],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"docker-in-docker": "latest",
"docker-from-docker": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Change these settings to your own preference
indent_style = space
indent_size = 4

[*.{ts,tsx,js,jsx,json,css,scss,yml,html,vue}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
src/main/docker/
jest.conf.js
webpack/
target/
build/
node/
coverage/
postcss.config.js
target/classes/static/
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@angular-eslint/eslint-plugin", "@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@angular-eslint/recommended",
"prettier",
"eslint-config-prettier"
],
"env": {
"browser": true,
"es6": true,
"commonjs": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": ["./tsconfig.app.json", "./src/test/javascript/cypress/tsconfig.json", "./tsconfig.spec.json"]
},
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "jhi",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "jhi",
"style": "camelCase"
}
],
"@angular-eslint/relative-url-prefix": "error",
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"{}": false
}
}
],
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"constructor",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/unbound-method": "off",
"arrow-body-style": "error",
"curly": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"guard-for-in": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-eval": "error",
"no-labels": "error",
"no-new": "error",
"no-new-wrappers": "error",
"object-shorthand": ["error", "always", { "avoidExplicitReturnArrows": true }],
"radix": "error",
"spaced-comment": ["warn", "always"]
}
}
Loading

0 comments on commit 99cc15b

Please sign in to comment.