Merge "Add Super Committer documentation"
[docs.git] / docs / release-process / project-release.rst
1 **************************
2 Project Standalone Release
3 **************************
4
5 This page explains how a project can release independently outside of the
6 OpenDaylight simultanious release.
7
8 Preparing your project for release
9 ==================================
10
11 A project can produce a staging repository by using one of the following
12 methods against the {project-name}-maven-stage-{stream} job:
13
14 * Leave a comment ``stage-release`` against any patch for the stream to build
15 * Click ``Build with Parameters`` in Jenkins Web UI for the job
16
17 This job performs the following duties:
18
19 1. Removes -SNAPSHOT from all pom files
20 2. Produces a taglist.log, project.patch, and project.bundle files
21 3. Runs a `mvn clean deploy` to a local staging repo
22 4. Pushes the staging repo to a Nexus staging repo
23    https://nexus.opendaylight.org/content/repositories/<REPO_ID>
24    (REPO_ID is saved to staging-repo.txt on the log server)
25 5. Archives taglist.log, project.patch, and project.bundle files to log server
26
27 The files taglist.log and project.bundle can be used later at release time to
28 reproduce a byte exact commit of what was built by the Jenkins job. This can
29 be used to tag the release at release time.
30
31 Releasing your project
32 ======================
33
34 Once testing against the staging repo has been completed and project has
35 determined that the staged repo is ready for release. A release can the be
36 performed as follows:
37
38 1. Ask helpdesk to sign the artifacts in staging repo
39 2. Ask helpdesk to promote the staging repo
40 3. Download taglist.log and project.bundle files. They can be found in the
41    "patches" directory of the related jenkins release job logs.
42 4. Read taglist.log and checkout the commit hash listed
43 5. Merge the project.bundle patches
44 6. Git tag the release
45 7. Push release tag to Gerrit
46
47 Steps 4-7 as bash:
48 You will need a working GPG config to sign the release Git tag ("-s" option)
49
50 .. code:: bash
51
52     PATCH_DIR=/tmp/patches
53     PROJECT=odlparent
54     VERSION=1.2.3
55     git checkout $(awk '{print $NF}' "$PATCH_DIR/taglist.log")
56     git fetch "$PATCH_DIR/$PROJECT.bundle"
57     git merge --ff-only FETCH_HEAD
58     git tag -asm "$PROJECT $VERSION" "v$VERSION"
59     git push origin "v$VERSION"
60
61 Once complete the Git tag should be available in Gerrit and the Artifacts should
62 appear in the Nexus opendaylight.release repo.
63
64 The following shell script will do this for you:
65
66 .. code:: bash
67
68     #!/bin/sh
69
70     set -e
71
72     if [ $# != 3 ]; then
73         echo Usage: $0 project version log-URL
74         echo fetches a project release\'s logs from log-URL and tags the git repository
75         exit 1
76     fi
77
78     PROJECT=$1
79     VERSION=$2
80     PATCH_DIR=/tmp/patches
81
82     mkdir -p $PATCH_DIR
83     cd $PATCH_DIR
84     rm -f ${PROJECT}.bundle taglist.log{,.gz}
85     wget ${3}/patches/{${PROJECT}.bundle,taglist.log.gz}
86     gunzip taglist.log.gz
87     cd -
88     git checkout $(awk '{print $NF}' "$PATCH_DIR/taglist.log")
89     git fetch "$PATCH_DIR/$PROJECT.bundle"
90     git merge --ff-only FETCH_HEAD
91     git tag -asm "$PROJECT $VERSION" "v$VERSION"
92     git push origin "v$VERSION"
93
94 You need to run it from a clone git repository of your project,
95 and give it as arguments the project’s short name, the newly-
96 released version, and the URL of the release build’s logs; for
97 example:
98
99 .. code:: bash
100
101     sign-odl-release odlparent 4.0.0 https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/odlparent-maven-release-master/11/