Getting Started - jpvlsmv/cc-template-pack GitHub Wiki

Getting started with cc-template-pack

What you need

The first thing you need is a use case. Preferably one that clearly and unambiguously defines the syntax and semantics of the input data, how that data should be transformed, and the desired structure and destination of the output data. In the real world, we make do with what we have.

Apply the template

~/cribl$ git clone https://github.com/jpvlsmv/cc-template-pack cc-mynewpack
Cloning into 'cc-mynewpack'...
remote: Enumerating objects: 100, done.
remote: Counting objects: 100% (100/100), done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 100 (delta 33), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (100/100), 24.99 KiB | 2.27 MiB/s, done.
Resolving deltas: 100% (33/33), done.
~/cribl$ cd cc-mynewpack/
~/cribl/cc-mynewpack$ git remote remove origin
~/cribl/cc-mynewpack$ ls
data  default  LICENSE  package.json  README.md  README-newpack.md
~/cribl/cc-mynewpack$ git rm README.md
rm 'README.md'
~/cribl/cc-mynewpack$ git mv README-newpack.md README.md
~/cribl/cc-mynewpack$ cat package.json
{
  "name":"cc-template-pack",
  "version":"0.0.3",
  "author":"Joe Moore (jpvlsmv) - cc",
  "description":"Template to provide the required elements and best practices of a pack - !!GITREV +datatype1!!",
  "displayName":"cc-template-pack"
}
~/cribl/cc-mynewpack$ vi package.json
~/cribl/cc-mynewpack$ cat package.json
{
  "name":"cc-mynewpack",
  "version":"0.1.0",
  "author":"Me (my-user) - cc",
  "description":"This is my pack!  It serves its own purpose",
  "displayName":"cc-mynewpack"
}
~/cribl/cc-mynewpack$ git add package.json
~/cribl/cc-mynewpack$ git diff --stat HEAD
 README-newpack.md | 30 ------------------------------
 README.md         | 66 ++++++++++++++++++++++++++----------------------------------------
 package.json      | 10 +++++-----
 3 files changed, 31 insertions(+), 75 deletions(-)
~/cribl/cc-mynewpack$ git commit -m "I have customized the template for my new pack"
[main de08b5d] I have customized the template for my new pack
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename README-newpack.md => README.md (100%)

Create your parts

Create the pipelines and routes and knowledge items via the Stream web UI, when finished export the newpack in Merge mode. It's a good idea to update the package version info, so that the UI shows version 0.1.1 (for this example)

Unpack the .crbl file into your git working tree

~/cribl/cc-mynewpack$ tar xfz ~/Downloads/cc-mynewpack_0.1.1.crbl

Review what has changed

~/cribl/cc-mynewpack$ git diff --stat

Commit your changes

~/cribl/cc-mynewpack$ git add .
~/cribl/cc-mynewpack$ git commit -m "Integrate UI changes into pack"

Remove template examples

Release

You can store & collaborate via github.com if you want. Set up your local working directory to remote its changes to your github account

~/cribl/cc-mynewpack$ git remote add origin https://github.com/myusername/cc-mynewpack
~/cribl/cc-mynewpack$ git push origin main

There is a github action defined in the .github/workflows/release.yml that creates a .crbl file for you. In the github web interface, go to the Releases page, and [Draft a new release]

Pick an existing vX.Y.Z as the tag, or type the new version to create a new tag, give it a title and description, then hit "Publish release"

Once the workflow action bundles up your new version, the .crbl file will show up as an available download in the Releases page.