Skip to content

Commit

Permalink
auto-generated files
Browse files Browse the repository at this point in the history
All auto-generated files from running `build.sh`
  • Loading branch information
practicalli-johnny committed Dec 9, 2022
1 parent 98f6859 commit ce73c82
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .automation/generated/linter-links-previews.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
"image": "https://avatars1.githubusercontent.com/u/284934?s=400&v=4",
"title": "borkdude/clj-kondo"
},
"cljstyle": {
"description": "A tool for formatting Clojure code. Contribute to greglook/cljstyle development by creating an account on GitHub.",
"image": "https://opengraph.githubassets.com/bf0d187aea6f03a804178458080b2be18a5fd1bf8d8cc353ff3150743aae9805/greglook/cljstyle",
"title": "GitHub - greglook/cljstyle: A tool for formatting Clojure code"
},
"coffeelint": {
"description": "\n CoffeeLint is a style checker that helps keep\n CoffeeScript\n code clean and consistent. CoffeeScript does a great job at\n insulating programmers from many of\n JavaScript's bad parts, but it won't help enforce a consistent style\n across a code base. CoffeeLint can help with that.\n ",
"image": null,
Expand Down
102 changes: 102 additions & 0 deletions .automation/test/clojure/clojure_good_2.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
;; --------------------------------------------------
;; Correctly formatted namespace
;; --------------------------------------------------


(ns good.namespace
"Fraud API service component lifecycle management"
(:gen-class)
(:require
;; Application dependencies
[practicalli.gameboard.router :as router]
[practicalli.gameboard.environment :as environment]

;; System dependencies
[org.httpkit.server :as http-server]
[integrant.core :as ig]
[com.brunobonacci.mulog :as mulog]))


;; --------------------------------------------------
;; Configure and start application components

;; Start mulog publisher for the given publisher type, i.e. console, cloud-watch
#_{:clj-kondo/ignore [:unused-binding]}
(defmethod ig/init-key ::log-publish
[_ {:keys [mulog] :as config}]
(mulog/log ::log-publish-component :publisher-config mulog :local-time (java.time.LocalDateTime/now))
(let [publisher (mulog/start-publisher! mulog)]
publisher))

;; Connection values for Relational Database
;; return hash-map of connection values: endpoint, access-key, secret-key
(defmethod ig/init-key ::relational-store
[_ {:keys [connection] :as config}]
(mulog/log ::persistence-component :connection connection :local-time (java.time.LocalDateTime/now))
config)

;; Configure environment for router application, e.g. database connection details, etc.
(defmethod ig/init-key ::router
[_ config]
(mulog/log ::app-routing-component :app-config config)
(router/app config))


;; HTTP server start - returns function to stop the server
(defmethod ig/init-key ::http-server
[_ {:keys [handler port join?]}]
(mulog/log ::http-server-component :handler handler :port port :local-time (java.time.LocalDateTime/now))
(http-server/run-server handler {:port port :join? join?}))


;; Shutdown HTTP service
(defmethod ig/halt-key! ::http-server
[_ http-server-instance]
(mulog/log ::http-server-component-shutdown :http-server-object http-server-instance :local-time (java.time.LocalDateTime/now))
;; Calling http instance shuts down that instance
(http-server-instance))


;; Shutdown Log publishing
(defmethod ig/halt-key! ::log-publish
[_ publisher]
(mulog/log ::log-publish-component-shutdown :publisher-object publisher :local-time (java.time.LocalDateTime/now))
;; Pause so final messages have chance to be published
(Thread/sleep 250)
;; Call publisher again to stop publishing
(publisher))


(defn stop
"Stop service using Integrant halt!"
[system]
(mulog/log ::http-server-sigterm :system system :local-time (java.time.LocalDateTime/now))
;; (println "Shutdown of Practicalli Gameboard service via Integrant")
(ig/halt! system))


;; --------------------------------------------------
;; Application entry point

(defn -main
"Practicalli service is started with `ig/init` and the Integrant configuration,
with the return value bound to the namespace level `system` name.
Aero is used to configure Integrant configuration based on profile (dev, test, prod),
allowing environment specific configuration, e.g. mulog publisher
The shutdown hook calling a zero arity function, gracefully stopping the service
on receipt of a SIGTERM from the infrastructure, giving the application 30 seconds before forced termination."
[]

(let [profile (or (keyword (System/getenv "SERVICE_PROFILE"))
:dev)

;; Add keys to every event / publish profile use to start the service
_ (mulog/set-global-context!
{:app-name "Practicalli Gameboard Service" :version "0.1.0" :env profile})

system (ig/init (environment/aero-prep profile))

_ (mulog/log ::gameboard-system :system-config system)]

;; TODO: capture the reason for the shutdown - i.e. can we capture the sigterm
(.addShutdownHook (Runtime/getRuntime) (Thread. ^Runnable #(stop system)))))
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#############################################################################################
#FROM__START
FROM mvdan/shfmt:latest-alpine as shfmt
FROM cljkondo/clj-kondo:2022.10.14-alpine as clj-kondo
FROM cljkondo/clj-kondo:2022.11.02-alpine as clj-kondo
FROM abogoyavlensky/cljstyle:0.15.0 as cljstyle
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:2.4.0 as editorconfig-checker
FROM ghcr.io/assignuser/chktex-alpine:latest as chktex
Expand Down Expand Up @@ -290,6 +291,7 @@ ENV PATH="/root/.cargo/bin:${PATH}"
#COPY__START
COPY --from=shfmt /bin/shfmt /usr/bin/
COPY --from=clj-kondo /bin/clj-kondo /usr/bin/
COPY --from=cljstyle /usr/local/bin/cljstyle /usr/bin/
COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --from=chktex /usr/bin/chktex /usr/bin/
Expand Down Expand Up @@ -411,6 +413,9 @@ RUN curl --retry 5 --retry-delay 5 -sLO "${ARM_TTK_URI}" \
# clj-kondo installation
# Managed with COPY --from=clj-kondo /bin/clj-kondo /usr/bin/

# cljstyle installation
# Managed with COPY --from=cljstyle /usr/local/bin/cljstyle /usr/bin/

# dotnet-format installation
&& /usr/share/dotnet/dotnet tool install -g dotnet-format \

Expand Down
58 changes: 29 additions & 29 deletions docs/standalone-linters.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Standalone linter docker images

| Linter key | Docker image | Size |
|:-------------------------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------:|
| ANSIBLE_ANSIBLE_LINT | oxsecurity/megalinter-only-ansible_ansible_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-ansible_ansible_lint/beta) |
| BASH_SHELLCHECK | oxsecurity/megalinter-only-bash_shellcheck:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-bash_shellcheck/beta) |
| CLOUDFORMATION_CFN_LINT | oxsecurity/megalinter-only-cloudformation_cfn_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-cloudformation_cfn_lint/beta) |
| DOCKERFILE_HADOLINT | oxsecurity/megalinter-only-dockerfile_hadolint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-dockerfile_hadolint/beta) |
| GO_REVIVE | oxsecurity/megalinter-only-go_revive:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-go_revive/beta) |
| GROOVY_NPM_GROOVY_LINT | oxsecurity/megalinter-only-groovy_npm_groovy_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-groovy_npm_groovy_lint/beta) |
| JAVA_CHECKSTYLE | oxsecurity/megalinter-only-java_checkstyle:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-java_checkstyle/beta) |
| JAVA_PMD | oxsecurity/megalinter-only-java_pmd:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-java_pmd/beta) |
| JAVASCRIPT_ES | oxsecurity/megalinter-only-javascript_es:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-javascript_es/beta) |
| JSON_ESLINT_PLUGIN_JSONC | oxsecurity/megalinter-only-json_eslint_plugin_jsonc:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-json_eslint_plugin_jsonc/beta) |
| JSX_ESLINT | oxsecurity/megalinter-only-jsx_eslint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-jsx_eslint/beta) |
| KOTLIN_KTLINT | oxsecurity/megalinter-only-kotlin_ktlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kotlin_ktlint/beta) |
| PHP_PSALM | oxsecurity/megalinter-only-php_psalm:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-php_psalm/beta) |
| PYTHON_BANDIT | oxsecurity/megalinter-only-python_bandit:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-python_bandit/beta) |
| REPOSITORY_CHECKOV | oxsecurity/megalinter-only-repository_checkov:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_checkov/beta) |
| REPOSITORY_DEVSKIM | oxsecurity/megalinter-only-repository_devskim:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_devskim/beta) |
| REPOSITORY_DUSTILOCK | oxsecurity/megalinter-only-repository_dustilock:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_dustilock/beta) |
| REPOSITORY_GITLEAKS | oxsecurity/megalinter-only-repository_gitleaks:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_gitleaks/beta) |
| REPOSITORY_SECRETLINT | oxsecurity/megalinter-only-repository_secretlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_secretlint/beta) |
| REPOSITORY_SEMGREP | oxsecurity/megalinter-only-repository_semgrep:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_semgrep/beta) |
| REPOSITORY_SYFT | oxsecurity/megalinter-only-repository_syft:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_syft/beta) |
| REPOSITORY_TRIVY | oxsecurity/megalinter-only-repository_trivy:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_trivy/beta) |
| TERRAFORM_TFLINT | oxsecurity/megalinter-only-terraform_tflint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_tflint/beta) |
| TERRAFORM_TERRASCAN | oxsecurity/megalinter-only-terraform_terrascan:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_terrascan/beta) |
| TERRAFORM_CHECKOV | oxsecurity/megalinter-only-terraform_checkov:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_checkov/beta) |
| TSX_ESLINT | oxsecurity/megalinter-only-tsx_eslint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-tsx_eslint/beta) |
| TYPESCRIPT_ES | oxsecurity/megalinter-only-typescript_es:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-typescript_es/beta) |
| Linter key | Docker image | Size |
| :----------| :----------- | :--: |
| ANSIBLE_ANSIBLE_LINT | oxsecurity/megalinter-only-ansible_ansible_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-ansible_ansible_lint/beta) |
| BASH_SHELLCHECK | oxsecurity/megalinter-only-bash_shellcheck:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-bash_shellcheck/beta) |
| CLOUDFORMATION_CFN_LINT | oxsecurity/megalinter-only-cloudformation_cfn_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-cloudformation_cfn_lint/beta) |
| DOCKERFILE_HADOLINT | oxsecurity/megalinter-only-dockerfile_hadolint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-dockerfile_hadolint/beta) |
| GO_REVIVE | oxsecurity/megalinter-only-go_revive:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-go_revive/beta) |
| GROOVY_NPM_GROOVY_LINT | oxsecurity/megalinter-only-groovy_npm_groovy_lint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-groovy_npm_groovy_lint/beta) |
| JAVA_CHECKSTYLE | oxsecurity/megalinter-only-java_checkstyle:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-java_checkstyle/beta) |
| JAVA_PMD | oxsecurity/megalinter-only-java_pmd:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-java_pmd/beta) |
| JAVASCRIPT_ES | oxsecurity/megalinter-only-javascript_es:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-javascript_es/beta) |
| JSON_ESLINT_PLUGIN_JSONC | oxsecurity/megalinter-only-json_eslint_plugin_jsonc:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-json_eslint_plugin_jsonc/beta) |
| JSX_ESLINT | oxsecurity/megalinter-only-jsx_eslint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-jsx_eslint/beta) |
| KOTLIN_KTLINT | oxsecurity/megalinter-only-kotlin_ktlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kotlin_ktlint/beta) |
| PHP_PSALM | oxsecurity/megalinter-only-php_psalm:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-php_psalm/beta) |
| PYTHON_BANDIT | oxsecurity/megalinter-only-python_bandit:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-python_bandit/beta) |
| REPOSITORY_CHECKOV | oxsecurity/megalinter-only-repository_checkov:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_checkov/beta) |
| REPOSITORY_DEVSKIM | oxsecurity/megalinter-only-repository_devskim:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_devskim/beta) |
| REPOSITORY_DUSTILOCK | oxsecurity/megalinter-only-repository_dustilock:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_dustilock/beta) |
| REPOSITORY_GITLEAKS | oxsecurity/megalinter-only-repository_gitleaks:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_gitleaks/beta) |
| REPOSITORY_SECRETLINT | oxsecurity/megalinter-only-repository_secretlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_secretlint/beta) |
| REPOSITORY_SEMGREP | oxsecurity/megalinter-only-repository_semgrep:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_semgrep/beta) |
| REPOSITORY_SYFT | oxsecurity/megalinter-only-repository_syft:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_syft/beta) |
| REPOSITORY_TRIVY | oxsecurity/megalinter-only-repository_trivy:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-repository_trivy/beta) |
| TERRAFORM_TFLINT | oxsecurity/megalinter-only-terraform_tflint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_tflint/beta) |
| TERRAFORM_TERRASCAN | oxsecurity/megalinter-only-terraform_terrascan:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_terrascan/beta) |
| TERRAFORM_CHECKOV | oxsecurity/megalinter-only-terraform_checkov:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-terraform_checkov/beta) |
| TSX_ESLINT | oxsecurity/megalinter-only-tsx_eslint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-tsx_eslint/beta) |
| TYPESCRIPT_ES | oxsecurity/megalinter-only-typescript_es:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-typescript_es/beta) |

7 changes: 6 additions & 1 deletion flavors/cupcake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#############################################################################################
#FROM__START
FROM mvdan/shfmt:latest-alpine as shfmt
FROM cljkondo/clj-kondo:2022.10.14-alpine as clj-kondo
FROM cljkondo/clj-kondo:2022.11.02-alpine as clj-kondo
FROM abogoyavlensky/cljstyle:0.15.0 as cljstyle
FROM hadolint/hadolint:v2.12.0-alpine as hadolint
FROM mstruebing/editorconfig-checker:2.4.0 as editorconfig-checker
FROM zricethezav/gitleaks:v8.15.0 as gitleaks
Expand Down Expand Up @@ -252,6 +253,7 @@ ENV PATH="/root/.cargo/bin:${PATH}"
#COPY__START
COPY --from=shfmt /bin/shfmt /usr/bin/
COPY --from=clj-kondo /bin/clj-kondo /usr/bin/
COPY --from=cljstyle /usr/local/bin/cljstyle /usr/bin/
COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --from=gitleaks /usr/bin/gitleaks /usr/bin/
Expand Down Expand Up @@ -309,6 +311,9 @@ RUN go install github.com/rhysd/actionlint/cmd/actionlint@latest && go clean --c
# clj-kondo installation
# Managed with COPY --from=clj-kondo /bin/clj-kondo /usr/bin/

# cljstyle installation
# Managed with COPY --from=cljstyle /usr/local/bin/cljstyle /usr/bin/

# hadolint installation
# Managed with COPY --from=hadolint /bin/hadolint /usr/bin/hadolint

Expand Down
1 change: 1 addition & 0 deletions flavors/cupcake/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"BASH_SHFMT",
"C_CPPLINT",
"CLOJURE_CLJ_KONDO",
"CLOJURE_CLJSTYLE",
"CLOUDFORMATION_CFN_LINT",
"COPYPASTE_JSCPD",
"CPP_CPPLINT",
Expand Down
Loading

0 comments on commit ce73c82

Please sign in to comment.