Skip to content

Commit

Permalink
Initial release (#1)
Browse files Browse the repository at this point in the history
* Initial release
  • Loading branch information
StrongestNumber9 authored Apr 17, 2024
1 parent 7ce4f1a commit c49958a
Show file tree
Hide file tree
Showing 55 changed files with 8,610 additions and 31 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on: push

jobs:
verify:
name: Verify Code
runs-on: ubuntu-latest

env:
COVERITY: coverity_tool

steps:
- uses: actions/checkout@v2

- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'

- name: Cache Local Maven Repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Compile Test and Verify
run: mvn --batch-mode clean verify

- name: Cache Coverity
id: cache_coverity
uses: actions/cache@v2
with:
path: ${{ env.COVERITY }}
key: coverity

- name: Download Coverity
if: steps.cache_coverity.outputs.cache-hit != 'true'
run: |
wget --quiet https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=rlo_11" -O ${{ env.COVERITY }}.tgz
mkdir -p ${{ env.COVERITY }}
tar zxvf ${{ env.COVERITY }}.tgz -C ${{ env.COVERITY }} --strip-components 1
- name: Compile Coverity
run: |
${{ env.COVERITY }}/bin/cov-build --dir cov-int mvn -DskipTests=true --batch-mode clean compile
tar czvf rlo_11.tgz cov-int
- name: Upload to Coverity
run: curl --silent --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form file=@rlo_11.tgz --form version="${GITHUB_REF##*/}" --form description="automated upload" https://scan.coverity.com/builds?project=rlo_11
51 changes: 51 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Upload Release

on:
release:
types: published

jobs:
upload:
name: Upload
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Local Maven Repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'

server-id: ossrh
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_TOKEN

gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Setup GitHub Packages
uses: actions/setup-java@v2
with:
java-version: 8.0.292+10
distribution: 'adopt'

- name: Publish to GitHub Packages
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
target/*
/target/
.settings/*
.vscode/*
.classpath
.factorypath
.project
/dependency-reduced-pom.xml
.idea/**
*.iml
.flattened-pom.xml
30 changes: 28 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
Expand All @@ -659,3 +659,29 @@ specific requirements.
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

Additional permission under GNU Affero General Public License version 3
section 7

If you modify this Program, or any covered work, by linking or combining it with
other code, such other code is not for that reason alone subject to any of the
requirements of the GNU Affero GPL version 3 as long as this Program is the same
Program as licensed from Suomen Kanuuna Oy without any additional modifications.

Supplemented terms under GNU Affero General Public License version 3
section 7

Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified
versions must be marked as "Modified version of" The Program.

Names of the licensors and authors may not be used for publicity purposes.

No rights are granted for use of trade names, trademarks, or service marks
which are in The Program if any.

Licensee must indemnify licensors and authors for any liability that these
contractual assumptions impose on licensors and authors.

To the extent this program is licensed as part of the Commercial versions of
Teragrep, the applicable Commercial License may apply to this file if you as
a licensee so wish it.
75 changes: 46 additions & 29 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,47 +1,64 @@
// Before publishing your new repository:
// 1. Write the readme file
// 2. Update the issues link in Contributing section in the readme file
// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory

= repo-template

// Add a short description of your project. Tell what your project does and what it's used for.

This is a template repository for Teragrep organization.
= Java Record Routing Library

== Features

// List your project's features
- Host+Tag based routing: CFE07Routing
- Host+Tag based index and sourcetype enrichment: CFE12Routing
- Authentication Token based Host+Tag information enrichment: CFE16Routing
- Account ID + LogGroup based Host+Tag information enrichment: KIN02Routing

== Examples

== Documentation
=== CFE07Routing

See the official documentation on https://docs.teragrep.com[docs.teragrep.com].
[source, java]
--
CFE07Routing cfe07Routing = new CFE07Routing("src/test/resources/cfe_07");

== Limitations
RoutingKey key = new RoutingKey("group-one-host-one", "group-one-tag-two");

// If your project has limitations, please list them. Otherwise remove this section.
for (String target : cfe07Routing.getTargets(key)) {
// spool target
if ("spool".equals(target)) {
// do spool stuff
}
}

== How to [compile/use/implement]
--

// add instructions how people can start to use your project
=== CFE12Routing

== Contributing
[source, java]
--
CFE12Routing cfe12Routing = new CFE12Routing("src/test/resources/cfe_12");

// Change the repository name in the issues link to match with your project's name
RoutingKey key = new RoutingKey("example-host", "124f76f0-net");

You can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.
for (String index : cfe12Routing.getIndexes(key)) {
for (String sourcetype : cfe12Routing.getSourcetypes(key)) {
// do stuff for each index and for each sourcetype
}
}
--

Contribution requirements:
=== CFE16Routing

. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.
. Security checks must pass
. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.
. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).
[source, java]
--
CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16");
RoutingKey key = cfe16Routing.getRoutingKey("My RoutingKey having token");

Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].
String hostname = key.getHostname();
String appName = key.getAppName();
--

=== Contributor License Agreement
=== KIN02Routing

Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
[source, java]
--
KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02");
RoutingKey key = kin02Routing.getRoutingKey("1234567890","/example/logGroupName/ThatExists");

You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.
String hostname key.getHostname();
String appName = key.getAppName();
--
Loading

0 comments on commit c49958a

Please sign in to comment.