Overview
Bacon is a new Java CLI for ProjectNCL 2.0 combining features of the older PNC CLI, DependencyAnalysis CLI and PiG tooling.
PiG (Product Files Generator) was introduced to automate the steps that don’t require human intervention. It provides tracking through holding the configuration within a YAML file stored within a git repository. This simplified the productisation process and by automating it, the process was made repeatable and less error prone. The process to create a product itself is complex with multiple steps involved - for instance configuring PNC entities (products/projects/build configurations), creating a maven repository, gathering licenses etc.
The PiG capabilities that have been merged into Bacon are:
- Create and update any PNC entities required. All the build configs involved are grouped into a build group
- Trigger PNC builds
- Wait for the builds to finish
- Perform a release pushing builds to brew
- Generate maven repository zip in one of the following ways
- from a bom file; generates a synthetic project based on a bom file produced by one of the builds and gathers a repository containing all the artifacts required to build such project
- based on build configs or the whole build group - with all the artifacts produced by the builds and all the dependencies of the buildsy
- from a repository generated by one of the builds - repackages the given repository and adds any missing source jars, parent poms, checksums to it
- Generate license information - using Licenses Generator, gather information from the artifact poms and license information exposed by the EAP team and create a properly formatted license zip
- Generate a source zip, a zip file containing sources of all the builds performed for the product
- Generate a javadoc zip with javadocs of all the projects that make a product
- Generate a CSV file listing all the artifacts in the repository along with info on their origin and whether they are released to MRRC or not. That’s especially useful for preparing Cross Product Agreement and Shared Content Request documents and identifying any artifacts that should not be used.
On top of the above, if needed, product-specific add-ons can be easily added and configured from the same configuration file. Add-ons have access to information about the performed builds, artifacts they created and consumed, can access the repository zip, etc. One example of an add-on is Quarkus community dependency analysis add-on that checks for runtime community dependencies and provides information on possible ways of eliminating them.
Release Notes
For a list of changes please see here
Installation and Usage
Compile:
mvn clean install
Run after compilation:
java -jar cli/target/bacon.jar
Java JDK 11 is the supported runtime. If you are installing Bacon on MacOs, please read the pre-requiste section. If you are running PNC internally with a company-signed TLS certificate, please read the TLS certificate section
To install the latest released version:
curl -fsSL https://raw.github.com/project-ncl/bacon/main/bacon_install.py | python3 -
To install a specific released version:
curl -fsSL https://raw.github.com/project-ncl/bacon/main/bacon_install.py | python3 - 2.0.1
To install the latest snapshot (no need to compile):
curl -fsSL https://raw.github.com/project-ncl/bacon/main/bacon_install.py | python3 - snapshot
This will install the bacon
, pig
, da
and pnc
commands in the ~/bin
directory, which on Linux will make it available in your shell.
To update the installed version:
# latest released version
bacon update
# specifc released version
bacon update 2.0.1
# snapshot version
bacon update snapshot
Pre-requisite for MacOs
- Ensure
~/bin
is added to your shell’s $PATH, unlike Fedora this is not added by default. Depending on which shell you run you can add it by running:
# ZSH (Default as of macOs 10.15 Catalina)
echo 'export PATH="$PATH:${HOME}/bin"' >> ~/.zshrc
# BASH
echo 'export PATH="$PATH:${HOME}/bin"' >> ~/.bash_profile
- Ensure Python 3 is installed, this can be achieved using homebrew by running:
brew install python3
TLS Certificate
If PNC is deployed internally using a company-signed TLS certificate, The Java JDK will complain about using an untrusted certificate. We need to add the public key of the certificate to the Java truststore. There are a few ways to remedy this:
- When using the default JDK from your Linux distro, there might be a certificate rpm present that will add the company-signed TLS certificate to the Java truststore. The certificate rpm may not apply the TLS certificate to custom JDKs such as OracleJDK.
- If there is no such certificate rpm, the company public key can be added to the Java truststore using:
sudo keytool -import -alias <company>-<cert> -file <file of company public key.crt> -trustcacerts -storepass changeit --noprompt
Feature Guide
Below are links to more specific information about configuring sets of features in PME: