...
Warning |
---|
With care an expert can start from an intermediate phase if repositories early in the release process such as policy/common or policy/models are not being released. To do this, the expert can carefully edit your local copy of the releasePhase.sh script and comment out the parts of each release phase that the expert does not want to execute. For example, if the expert wants to start from Phase 8 below (use the existing versions of policy/parent, policy/common, policy/docker, and policy/models), the expert can comment out the operation to update the policy/models snapshots and safely start from Phase 8. |
Running a Release
In each phase run getReleaseData.sh followed by releasePhase.sh.
Code Block | ||
---|---|---|
| ||
Warning | ||
The getReleaseData.sh script, among other things, retrieves the repository tags from the repository being released from nordix gerrit. After a repo release has been carried out in a stage (reviews are merged etc), the tag for the release is automatically created in github. There can sometimes be a delay in propagating the tag to onap gerrit and then especially to nordix gerrit. This means that the tags will be unavailable for getReleaseData.sh to fetch. And thus, the pf_release_data.csv will NOT have the latest released tag. In this case, you MUST manually update the release number in the pf_release_data.csv file. For example, after stage 2, the parent latest version tag may not be in nordix yet. You will notice, after stage 2, when you run getReleaseData.sh, the line with policy/parent in the pf_release_data.csv file does not have the new version. So, you just update that line with the new version (no need to update the SNAPSHOT version) - and then continue with stage 3. |
Running a Release
In each phase run getReleaseData.sh followed by releasePhase.sh.
Code Block | ||
---|---|---|
| ||
% getReleaseData.sh -l onap -b jakarta
% releasePhase.sh -l onap -i POLICY-112911 -p 1
% getReleaseData.sh -l onap -b jakarta
% releasePhase.sh -l onap -i POLICY-112911 -p 2
...........................
% getReleaseData.sh -l onap -b jakarta
% releasePhase.sh -l onap -i POLICY-112911 -p 15 |
...
Phase | Actions Performed | ||
---|---|---|---|
1 | Update internal references in policy/parent | ||
2 | Stage release on policy/parent in Gerrit | ||
3 | Update snapshots in policy/parent | ||
4 | Update snapshots in policy/common Update snapshots in policy/docker Stage release on policy/common in Gerrit | 5 |
|
5 | Update snapshots in policy/common Update snapshots in policy/docker Update policy/parent and policy/common references in policy/models | ||
6 | Stage release on policy/models in Gerrit Release policy/models Maven artifacts | ||
7 | Release policy/models Docker images | ||
8 | Update snapshots in policy/models Update policy/parent, policy/common, policy/models and base Docker references in policy/api , policy/common, policy/models and base Docker references in policy/ models | ||
6 | Stage release on policy/models in Gerrit Release policy/models Maven artifacts | ||
7 | Release clamp | 8 | Update snapshots and base Docker references in policy/ modelsapex-pdp |
9 | Stage release on policy/api in Gerrit | ||
9 | Stage release on policy/api in Gerrit | ||
10 | Release policy/api Docker images | ||
11 | Update snapshots in policy/api Update snapshots in policy/pap Update snapshots in policy/distribution Update snapshots in policy/clamp Update snapshots in policy/apex-pdp Update snapshots in policy/drools-pdp Update snapshots in policy/xacml-pdp Update policy/parent, policy/common, policy/models, policy/drools-pdp and base Docker references in policy/drools-applications Update policy/parent, policy/common, policy/models, policy/apex-pdp and base Docker references in policy/gui | ||
12 | Stage release on policy/drools-applications in Gerrit | ||
13 | Stage release on policy/drools-applications in Gerrit (Note: a second stage-release is required on drools-applications following maven artifact release) | ||
14 | Update snapshots in policy/drools-applications | ||
15 | Store the updated pf_release_data.sh file in policy/parent with an optional Gerrit tag for the release |
Updating image revisions in OOM
When releasing in ONAP, the revisions of the Policy Framework Docker images must be updated in OOM.
The image revisions in the Policy Framework values.yaml files are updated using the updateOomImages.sh script. The script updates the image revisions in OOM and creates a commit in Gerrit for the change.
...
Run the updateOomImages.sh script:
...
language | bash |
---|
...
distribution in Gerrit | |
10 | Release policy/api Docker images |
11 | Update snapshots in policy/api Update snapshots in policy/pap Update snapshots in policy/distribution Update snapshots in policy/clamp Update snapshots in policy/apex-pdp Update snapshots in policy/drools-pdp Update snapshots in policy/xacml-pdp Update policy/parent, policy/common, policy/models, policy/drools-pdp and base Docker references in policy/drools-applications Update policy/parent, policy/common, policy/models, policy/apex-pdp and base Docker references in policy/gui |
12 | Stage release on policy/drools-applications in Gerrit |
13 | Stage release on policy/drools-applications in Gerrit (Note: a second stage-release is required on drools-applications following maven artifact release) |
14 | Update snapshots in policy/drools-applications |
15 | Store the updated pf_release_data.sh file in policy/parent with an optional Gerrit tag for the release |
Updating image revisions in OOM
When releasing in ONAP, the revisions of the Policy Framework Docker images must be updated in OOM.
The image revisions in the Policy Framework values.yaml files are updated using the updateOomImages.sh script. The script updates the image revisions in OOM and creates a commit in Gerrit for the change.
- Clone a copy of the OOM repository into a suitable location. The suggested location is onap/oom, where the Policy Framework repositories are in onap/policy/parent, onap/policy/common etc.
- Make sure that the correct branch of OOM is checked out, if you are, for example, working on a Jakarta release of the Policy Framework, check out the Jakarta branch on the OOM repository.
Run the updateOomImages.sh script:
Code Block language bash % updateOomImages.sh -l onap -i POLICY-112911
A commit is raised that updates OOM for the new Policy Framework release. The commit is inspected and merged as normal.
Tagging a Release
When an official release is completed, a tag for that release is created on each repository in Gerrit. The official releases from the Policy Framework are catalogued on the Policy Framework Project: Component Versions page. The following types of releases are tagged:
Type | Numbering | Description |
---|---|---|
ONAP | x.y.0-ONAP | An ONAP Full Release, where x.y.0 is the ONAP release version |
ONAP Maintenance | x.y.z-ONAP | An ONAP Maintenance Release, where x.y.z is the ONAP release patch version |
Policy Framework Interim | x.y.z-PF-In | An interim release of the Policy Framework for Policy Framework stakeholders, to be included in the next ONAP Maintenance release on that branch. x.y.z is the ONAP release version and n is the Policy Framework Interim release number on that ONAP release version. |
If a release is not made available to ONAP or to stakeholders (such as a release for integration testing), the release need not be tagged.
When preforming the final phase in the release process, use the -t option on the releasePhase.shscript to set a tag on the release data stored in Gerrit for the release. The tag used should match the tag used on the repositories in Gerrit for the release.
Code Block | ||
---|---|---|
| ||
releasePhase.sh -l onap -p 15 -i POLICY- |
...
A commit is raised that updates OOM for the new Policy Framework release. The commit is inspected and merged as normal.
Tagging a Release
When an official release is completed, a tag for that release is created on each repository in Gerrit. The official releases from the Policy Framework are catalogued on the Policy Framework Project: Component Versions page. The following types of releases are tagged:
...
112911 -t 1.10.0-ONAP |
...
An interim release of the Policy Framework for Policy Framework stakeholders, to be included in the next ONAP Maintenance release on that branch. x.y.z is the ONAP release version and n is the Policy Framework Interim release number on that ONAP release version.
If a release is not made available to ONAP or to stakeholders (such as a release for integration testing), the release need not be tagged.
...
Branching
Branching is where a new branch is created on each repository in the Policy Framework and the minor revision of each repository is stepped. Branching is usually performed when development is completed for a release and development is moving onto the next release.
To branch, perform the following steps:
- In Gerrit, create the new branch off the master branch in each repository
- Check that all the branches have been created correctly
On the master branch, run the getReleaseData.sh script to update the pf_release_data.csv file
Code Block language bash getReleaseData.sh -l onap
Run the newReleaseSnapshots.sh script to update the snapshot versions on all the repositories and merge the generated commits
For a minor release run the script as follows:
Code Block language bash newReleaseSnapshots.sh -l onap -i POLICY-112911
For a major release run the script with the -m flag as follows:
Code Block language bash newReleaseSnapshots.sh -m -l onap -i POLICY-112911
Run the resolveRefs.sh script to update the cross references and base docker images, then merge the generated commits
Code Block language bash
...
resolveRefs.sh -l onap -
...
i POLICY-112911
...
Branching
Branching is where a new branch is created on each repository in the Policy Framework and the minor revision of each repository is stepped. Branching is usually performed when development is completed for a release and development is moving onto the next release.
To branch, perform the following steps:
- In Gerrit, create the new branch off the master branch in each repository
- Check that all the branches have been created correctly
On the master branch, run the getReleaseData.sh script to update the pf_release_data.csv file
Code Block language bash getReleaseData.sh -l onap
Run the newReleaseSnapshots.sh script to update the snapshot versions and various references on all the repositories
Code Block language bash newReleaseSnapshots.sh -l onap -i POLICY-112911
- Add the new branch to the JJB job Yaml files in onap/ci-management/jjb/policy so that the Jenkins jobs for the new branch are created.
- Check out the release branch into a separate tree structure:
release_name/policy/parent
release_name/policy/common
etc. - On the release branch, edit the file release_name/policy/parent/docs/conf.py and change all references to master or latest to your release name (these variables are release, version and branch)
- On the release branch, edit the .gitreview file and change the line defaultbranch=master to defaultbranch=<release_name>, where <release_name> is the name of the new release
- Raise commits and merge the changes in 7. and 8. above.
The snapshot versions and references are now set correctly on the master branch for and the next release branch.
Example of Performing a Release
...