This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jrmcdonald/feat/initial-service
feat: initial commit of service
- Loading branch information
Showing
32 changed files
with
6,138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export KUBECONFIG=../../kubernetes-platform/artifacts/admin.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
applypatch-msg | ||
commit-msg | ||
post-applypatch | ||
post-commit | ||
post-merge | ||
post-receive | ||
post-rewrite | ||
post-update | ||
pre-applypatch | ||
pre-auto-gc | ||
pre-commit | ||
pre-merge-commit | ||
pre-push | ||
pre-rebase | ||
pre-receive | ||
prepare-commit-msg | ||
push-to-checkout | ||
sendemail-validate | ||
update | ||
husky.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Copied from https://github.com/spotbugs/spotbugs-gradle-plugin/blob/master/.githooks/post-checkout | ||
# | ||
# This script installs the development toolchain runs on node.js (commitlint, husky, prettier, etc.). | ||
# It helps Java engineers to set up full development toolchain seamless. | ||
# | ||
# Gradle plugin (ghooks.gradle) will install this git-hook script. | ||
# We use `post-checkout` because `pre-commit` is used by husky to lint code, and | ||
# `post-clone` is still unofficial so we have no other hook runs before the commit. | ||
|
||
set -e | ||
|
||
if [ ! -d "node_modules" ] | ||
then | ||
if [ -x "$(command -v yarn)" ] | ||
then | ||
echo "🔍🐛 node_modules directory not found, running `yarn install` to install the dev toolchain..." | ||
yarn install | ||
echo "🔍🐛 The dev toolchain has been installed." | ||
else | ||
echo "🔍🐛 The yarn command not found. Please install it to keep your commit clean:" | ||
echo "🔍🐛 https://yarnpkg.com/en/docs/install" | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
- '*/*' | ||
|
||
env: | ||
slack-channel: 'status-ci-cd' | ||
|
||
jobs: | ||
build: | ||
|
||
if: contains(toJson(github.event.commits), '[skip ci]') == false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 50 | ||
- run: | | ||
git fetch --no-tags --prune --depth=1 origin main | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Set up JDK 1.11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.11 | ||
|
||
- name: Set up Node 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Yarn Install | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Yarn Audit | ||
uses: jrmcdonald/yarn-audit-action@main | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Set up Gradle | ||
run: chmod +x gradlew | ||
|
||
- name: Build | ||
run: ./gradlew build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
id: semantic | ||
with: | ||
extra_plugins: | | ||
gradle-semantic-release-plugin | ||
@semantic-release/exec | ||
@semantic-release/git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | ||
|
||
- name: Docker Release | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: | | ||
./gradlew bootBuildImage | ||
docker login -u jrmcdonald -p ${{ secrets.DOCKER_IO_TOKEN }} | ||
docker push docker.io/jrmcdonald/techbyte-demo:${{ steps.semantic.outputs.new_release_version }} | ||
- uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: reports | ||
path: build/reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/** | ||
!**/src/test/** | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Node ### | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Jamie McDonald | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
plugins { | ||
id 'com.github.spotbugs' version "${spotbugsPluginVersion}" | ||
id 'com.gtramontina.ghooks.gradle' version "${ghooksPluginVersion}" | ||
id 'org.springframework.boot' version "${springBootPluginVersion}" | ||
id 'java' | ||
id 'java-library' | ||
} | ||
|
||
group = 'com.jrmcdonald' | ||
version = "${version}" | ||
sourceCompatibility = '11' | ||
targetCompatibility = '11' | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url = 'https://maven.pkg.github.com/jrmcdonald/ms-common' | ||
credentials { | ||
username = "jrmcdonald" | ||
password = project.findProperty('GITHUB_TOKEN') ?: System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
|
||
configurations { | ||
commonBom | ||
compileOnly.extendsFrom(commonBom) | ||
annotationProcessor.extendsFrom(commonBom) | ||
testCompileOnly.extendsFrom(commonBom) | ||
testAnnotationProcessor.extendsFrom(commonBom) | ||
implementation.extendsFrom(commonBom) | ||
testImplementation.extendsFrom(commonBom) | ||
testFixturesImplementation.extendsFrom(commonBom) | ||
|
||
[apiElements, runtimeElements].each { | ||
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) } | ||
it.outgoing.artifact(bootJar) | ||
} | ||
} | ||
|
||
dependencies { | ||
commonBom platform("com.jrmcdonald:ms-common-bom:${commonVersion}") | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
|
||
implementation 'com.github.spotbugs:spotbugs-annotations' | ||
implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.cloud:spring-cloud-starter-kubernetes-all' | ||
|
||
testCompileOnly 'org.projectlombok:lombok' | ||
testAnnotationProcessor 'org.projectlombok:lombok' | ||
|
||
testImplementation 'org.force66:BeanTester' | ||
testImplementation('org.springframework.boot:spring-boot-starter-test') { | ||
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' | ||
} | ||
} | ||
|
||
compileJava { | ||
options.compilerArgs << "-Werror" | ||
options.compilerArgs << "-Xlint:all" | ||
options.compilerArgs << "-Xlint:-try" | ||
options.compilerArgs << "-Xlint:-processing" | ||
} | ||
|
||
bootJar { | ||
enabled = true | ||
} | ||
|
||
jar { | ||
enabled = false | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
apply from: "${rootDir}/gradle/quality.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ambassador: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {extends: ['@commitlint/config-conventional']}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
org.gradle.jvmargs = -Xmx1024M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
org.gradle.caching = true | ||
version = 1.0.0 | ||
ghooksPluginVersion = 1.1.1 | ||
springBootPluginVersion = 2.3.1.RELEASE | ||
spotbugsPluginVersion = 4.4.4 | ||
spotbugsToolVersion = 4.0.6 | ||
commonVersion = 2.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
spotbugs { | ||
toolVersion.set("${spotbugsToolVersion}") | ||
} | ||
|
||
spotbugsMain { | ||
reports { | ||
xml.enabled(false) | ||
html.enabled(true) | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.