Nort Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Overview=
=Overview=


NORT (Nova Ordis Release Tools) is logic that enforces a way of doing software releases. In this respect, is opinionated. It enforces its opinions by driving various resources and tools (Maven, GitHub, artifact repositories, target systems upon the publicly-consumable artifacts are deployed, etc.) to interact in specific ways. NORT is driven by a very simple set of top-level commands: "release", "build", "install" and "deploy", which trigger [[#Sequences|sequence of operations]] described below. Those sequences of operations involve very complex - and distributed - interactions. In most cases, you will only need to use "release". This article describes concepts that are useful if you want to understand how NORT works.
nort (Nova Ordis Release Tools) is logic that enforces a way of doing software releases. In this respect, is opinionated. It enforces its opinions by driving various resources and tools (Maven, GitHub, artifact repositories, target systems upon the publicly-consumable artifacts are deployed, etc.) to interact in specific ways. NORT is driven by a very simple set of top-level commands: "release", "build", "install" and "deploy", which trigger [[#Sequences|sequence of operations]] described below. Those sequences of operations involve very complex - and distributed - interactions. In most cases, you will only need to use "release". This article describes concepts that are useful if you want to understand how NORT works.


=Dot Version=
=Dot Version=

Revision as of 20:08, 17 November 2016

Internal

Overview

nort (Nova Ordis Release Tools) is logic that enforces a way of doing software releases. In this respect, is opinionated. It enforces its opinions by driving various resources and tools (Maven, GitHub, artifact repositories, target systems upon the publicly-consumable artifacts are deployed, etc.) to interact in specific ways. NORT is driven by a very simple set of top-level commands: "release", "build", "install" and "deploy", which trigger sequence of operations described below. Those sequences of operations involve very complex - and distributed - interactions. In most cases, you will only need to use "release". This article describes concepts that are useful if you want to understand how NORT works.

Dot Version

A dot version is a label that marks a specific point in time in the evolution of a software project. It contains major, minor and patch components: "1.2.3". It does not contain a "SNAPSHOT" fragment. A dot version associated with an artifact indicates that the artifact was built based on source code that passed all the tests and it is ready for public consumption.

Major Component

Minor Component

Patch Component

Snapshot Version

A snapshot version is a label that marks a specific point in time in the evolution of a software project, and it primarily indicates that, at that time, the functionality provided by the project is not ready for public consumption. In other words, the source code tree is under development at that point in time. The "SNAPSHOT" level designates a snapshot version. Example: "1.2.3-SNAPSHOT-5".

Normally, a snapshot versioned artifact should never be used outside the development process. NORT routinely releases snapshot versioned artifacts but they are only used when dependent projects under development, themselves having a snapshot version, require new functionality or defect fixes of their dependencies. In that situation, the dependency releases a snapshot release, the dependent updates its metadata to point to the newly released dependency snapshot release, and its development continues. When the dependent is ready for a dot release, first the dependencies are "dot released" and then the dependent is "dot released". NORT provides logic to automate these workflows.

Snapshot Component

Current Version

The current version represents the version associated with a work area of a project. For Maven-built projects, is the <version> information written into the POM file in the work are of the project.


The current version is always a snapshot version, as projects are continuously evolving and they are in principle open for new functionality and defect fixes.

A version becomes a dot version during the release process. However, a dot version never lasts in a work area for more than a brief time interval. The dot version is used to build the corresponding artifacts (sources and binaries), which are by then installed in their corresponding repositories, as part of the release process. If all goes well the current version is immediately upgraded to the next logical SNAPSHOT. If something goes wrong, the current version remains set to the SNAPSHOT that failed to become a dot version, until the developer fixes the problem and repeats, successfully, the release process.

Release

A release consists in a sequence of operations - interactions with the local project work area, the build system metadata, and various external source code and binary repositories - which end with the generation of a set of release artifacts. Depending of the release type and the options used when the release was triggered, the artifacts will be different and will end up in different places. For more details, see the "sequences" section.

Release Types

Major

Minor

Patch

Snapshot

Custom

For syntax details see the release command.

Sequences

The Release Sequence

The "release sequence" is potentially all-encompassing. A full release sequence involves release qualification (testing, etc), release metadata updates, a build sequence, a install sequence and a deploy sequence.

The Build Sequence

The Install Sequence

The terminology comes from Maven "install" and means installing artifacts into a repository.

The Deploy Sequence

The Release Sequence

Keep in mind that for a snapshot release, the snapshot version is already in the workarea. For a dot release, it is not, so the sequence is a bit different.

The release sequence consists in the following steps:

  1. The release logic insures that the current version is a snapshot version. The release fails if it encounters a dot version in the work area.
  2. Release qualification: test, what else?
  3. All tests are executed.
  4. If at least one test fails, NORT reports and fails. The work area is guaranteed to be left in the exact state it was found before the release sequence was initiated.
  5. If release qualification passes, start the build sequence.
  6. If the build sequence passes, start the installation sequence
  7. If all tests pass, the artifacts corresponding to the release are built and placed in a staging directory in the work area (usually the target directory). If the artifact building fails, NORT reports and fails. The work area is guaranteed to be left in the exact state it was found before the release sequence was initiated.
  8. Installed in the corresponding artifact repositories. Usually, JARs are installed under their corresponding artifact directories and binary releases are installed under their corresponding "release" modules, both in the local Maven repository. For more details about artifacts and what repositories are they installed into, see "Release Artifacts" section.
  9. The installation sequence is automatically initiated, unless "release" command was configured to stop after execution.
  10. The local workarea version metadata is tentatively incremented according to the rules described in the "Release Types" section.

Release Artifacts

A release my produce one of the following artifact types:

JAR Libraries

Binary Distributions

Binary distributions are usually ZIP file containing everything an application needs in order to be installed on a new system. The binary distribution include libraries, wrapper scripts, release notes, documentation and possibly other artifacts.

The recommended technique to build complex binary distributions is to add a dedicated "release" module to the project and let the Maven assembly plug-in to handle the process. The details are described in the "Building a Maven Complex Release Artifact" article.

If a project has a binary distribution that is built by Maven, NORT will publish it in the local Maven repository, under the "release" module of the project.

Binary distributions may be built using a mechanism different from Maven, but irrespective to how the artifact is built, the release sequence ends in its publishing them in some form of local binary repository.

The Build Sequence

Consider if the build sequence is part of the release sequence, build sequence or standalone.

The Installation Sequence

Consider if the installation sequence is part of the release sequence or standalone.

The installation sequence consists in the following steps:

New Project Initialization

The command that carries out a new project initialization is nort initialize.

TODO: