If you release software, you will often need to test a release before deploying it to a production system or an externally accessible repository. For example, if you are developing a large, enterprise web application you may want to stage a release candidate to a production system and perform a series of rigorous tests before a release manager makes a decision to either return a system to development or deploy a system to production.
The Nexus Staging Suite in Nexus Professional allows an organization to create a temporary staging repository and to manage the promotion of artifacts from a staging repository to a release repository. This ability to create an isolated, release candidate repository that can discarded or promoted makes it possible to support the decisions that go into certifying a release.
Without the Staging Suite, when a developer deploys an artifact to a Hosted repository such as the Release repository, this artifact is published to a hosted repository and is immediately made available - there is no oversight, there is no approval or certification process. There is no chance to test the artifact before writing the artifact to a hosted repository. If there is a mistake in the release, often the only option available is to republish the artifacts to the release repository or deploy a new version of the artifacts.
While this is acceptable for some users, organizations and enterprises with a QA cycle often need a temporary staging repository for potential release candidates: a staging repository. With the Nexus Staging Suite, an organization can automatically stage releases to a temporary repository which can then be used to test and certify a set of artifacts before they are published to a final release repository. This temporary repository can then be promoted as a whole or dropped depending on the results of testing.
Here’s how staging works in Nexus Professional:
- A developer deploys an artifact (or a set of artifacts) to Nexus Professional.
- The Staging Suite intercepts this deployment and matches the artifact’s path against a set of Staging Profiles.
- If the path of the artifact activates a staging profile, a temporary staging repository is created and the artifacts are deployed to this repository.
- Once the developer has deployed a set of artifacts to Nexus, they will then "Close" the staging repository.
- The Staging Suite will then add this temporary staging repository to one or more Target Repository Groups.
Once the staging repository is closed, and the staging repository has been added to a Target repository group, the artifacts in the staging repository are then made available to developers or testers via a repository group. Tests can be performed on the artifacts as if they were already published in a hosted repository. From this point, one of two things can happen to a staging repository:
- Release
- A Nexus user can "release" a staging repository and select a hosted repository to publish artifacts to. Releasing the contents of a repository publishes all artifacts from the staging repository to a hosted repository and deletes the temporary staging repository.
- Drop
- A Nexus user can "drop" a staging repository. Dropping a staging repository will remove it from any groups and delete the temporary staging repository.
- Promote
- If your Nexus installation contains Build Promotion profiles, you will also see an option to "promote" a staging repository to a Build Promotion Group. When you promote a staging repository you can expose the contents of that staging repository via additional groups. Build Promotion profiles are explained in detail in the next section.
Nexus Professional also supports multi-level staging and build promotion. With multi-level staging, a staging repository can be tested and then promoted to a separate "build promotion" profile and exposed through different repository groups to allow for additional testing and qualification before a final release. Figure 10.4, “Multi-level Staging and Build Promotion” illustrates a potential use for multi-level staging:
- Stage
- A developer publishes artifacts to a QA staging profile which exposes the staged artifacts in a QA repository group used by an internal quality assurance team for testing.
- Promote to Beta
- Once the QA team has successfully completed testing, they promote the temporary staging repository to build promotion profile which will expose the staged artifacts to a limited set of customers who have agreed to act as a beta testers for a new feature.
- Release
- Once this closed beta testing period is finished, the staged repository is then released and the artifacts it contains are published to a hosted release repository and exposed via the public repository group.
To support this multi-level staging feature, you can configure Build Promotion profiles as detailed in Section 10.2.2, “Configuring Build Promotion Profiles”. Once you have promoted a Staging Repository to a Build Promotion profile, you can drop, promote, or release the artifacts it contains as detailed in Section 10.2, “Using the Nexus Staging Suite”.