Merge changes from topic 'DOCS-50'
[docs.git] / docs / generate-milestone-status.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 MILESTONE_STATUS_DIR="release-process/milestone-readouts/status"
13 mkdir -p "$MILESTONE_STATUS_DIR"
14
15 trim_trailing_whitespace() {
16     sed -e 's/[[:space:]]*$//'
17 }
18
19 trim_leading_and_trailing_whitespace() {
20     sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
21 }
22
23 {
24     echo "Milestone 0 Status"
25     echo "=================="
26     echo
27     echo ".. list-table:: Milestone 0 Status"
28     echo "   :widths: auto"
29     echo "   :header-rows: 1"
30     echo
31     echo "   * - Project ID"
32     echo "     - Offset"
33     echo "     - Category"
34     echo "     - Labels"
35     echo "     - Project Technical Lead"
36     echo "     - Committers Updated"
37
38     files=($(find release-process/milestone-readouts/m0 -type f | sort))
39     for f in ${files[@]}; do
40         project="$(basename $f | awk -F. '{print $1}')"
41         offset=$(grep 'Project Offset:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
42         category=$(grep 'Project Category:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
43         labels=$(grep 'Project Labels:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
44         ptl=$(grep 'Project PTL:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
45         ptl_name=$(echo $ptl | awk -F, '{print $1}' | trim_leading_and_trailing_whitespace)
46         ptl_email=$(echo $ptl | awk -F, '{print $2}' | trim_leading_and_trailing_whitespace)
47         ptl_irc=$(echo $ptl | awk -F, '{print $3}' | trim_leading_and_trailing_whitespace)
48         updated_committers=$(grep 'Project Committers is updated and accurate?' "$f" \
49             | awk -F'?' '{print $2}' | trim_leading_and_trailing_whitespace)
50
51         echo "   * - $project" | trim_trailing_whitespace
52         echo "     - $offset" | trim_trailing_whitespace
53         echo "     - $category" | trim_trailing_whitespace
54         echo "     - $labels" | trim_trailing_whitespace
55         echo "     - :name: $ptl_name" | trim_trailing_whitespace
56         echo "       :email: $ptl_email" | trim_trailing_whitespace
57         echo "       :irc: $ptl_irc" | trim_trailing_whitespace
58         echo "     - $updated_committers" | trim_trailing_whitespace
59     done
60 } > "$MILESTONE_STATUS_DIR/m0.rst"
61
62 {
63     echo "Milestone 1 Status"
64     echo "=================="
65     echo
66     echo ".. list-table:: Milestone 1 Status"
67     echo "   :widths: auto"
68     echo "   :header-rows: 1"
69     echo
70     echo "   * - Project ID"
71     echo "     - Project Technical Lead"
72     echo "     - Project Contact"
73     echo "     - Test Contact"
74     echo "     - Documentation Contact"
75     echo "     - Prior milestone updates?"
76     echo "     - Delivered milestone deliverables?"
77     echo "     - Special CI requirements?"
78     echo "     - Release Plan finalized?"
79     echo "     - APIs listed"
80     echo "     - Dependencies documented"
81     echo "     - Features requiring system test"
82     echo "     - Using ODL CI for testing"
83
84     files=($(find release-process/milestone-readouts/m1 -type f | sort))
85     for f in ${files[@]}; do
86         project="$(basename $f | awk -F. '{print $1}')"
87
88         ptl=$(grep 'Project PTL:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
89         ptl_name=$(echo $ptl | awk -F, '{print $1}' | trim_leading_and_trailing_whitespace)
90         ptl_email=$(echo $ptl | awk -F, '{print $2}' | trim_leading_and_trailing_whitespace)
91         ptl_irc=$(echo $ptl | awk -F, '{print $3}' | trim_leading_and_trailing_whitespace)
92
93         pc=$(grep 'Project Contact:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
94         pc_name=$(echo $ptl | awk -F, '{print $1}' | trim_leading_and_trailing_whitespace)
95         pc_email=$(echo $ptl | awk -F, '{print $2}' | trim_leading_and_trailing_whitespace)
96         pc_irc=$(echo $ptl | awk -F, '{print $3}' | trim_leading_and_trailing_whitespace)
97
98         tc=$(grep 'Test Contact:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
99         tc_name=$(echo $ptl | awk -F, '{print $1}' | trim_leading_and_trailing_whitespace)
100         tc_email=$(echo $ptl | awk -F, '{print $2}' | trim_leading_and_trailing_whitespace)
101         tc_irc=$(echo $ptl | awk -F, '{print $3}' | trim_leading_and_trailing_whitespace)
102
103         dc=$(grep 'Documentation Contact:' "$f" | awk -F: '{print $2}' | trim_leading_and_trailing_whitespace)
104         dc_name=$(echo $ptl | awk -F, '{print $1}' | trim_leading_and_trailing_whitespace)
105         dc_email=$(echo $ptl | awk -F, '{print $2}' | trim_leading_and_trailing_whitespace)
106         dc_irc=$(echo $ptl | awk -F, '{print $3}' | trim_leading_and_trailing_whitespace)
107
108         prior_milestone_updates=$(grep 'prior milestone readouts?' "$f" | awk -F'?' '{print $2}' | trim_leading_and_trailing_whitespace)
109         delivered_milestone_deliverables=$(awk -F'?' '/deliverables planned for this milestone delivered/,/successfully?/ {print $2}' "$f" | tr -d '\n' | trim_leading_and_trailing_whitespace)
110         ci_needs=$(awk -F'?' '/Does your project have any special needs in CI Infrastructure/ {print $2}' "$f" | trim_leading_and_trailing_whitespace)
111         release_plan_finalized=$(awk -F'?' '/Is your project release plan finalized/ {print $2}' "$f" | trim_leading_and_trailing_whitespace)
112
113         api_shortname=$(awk -F'?' '/Does each API have a useful short name/ {print $2}' "$f" | trim_leading_and_trailing_whitespace)
114         api_interfaces_listed=$(awk -F'?' '/Are the Java interface and\/or YANG files listed for each API/ {print $2}' "$f" | trim_leading_and_trailing_whitespace)
115         api_labeled=$(awk -F'?' '/labeled as tentative, provisional, or stable as appropriate for/,/each API/ {print $2}' "$f" | tr -d '\n' | trim_leading_and_trailing_whitespace)
116         api_features_identified=$(awk -F'?' '/call out the OSGi bundles and\/or Karaf features providing the API/,/for each API/ {print $2}' "$f" | tr -d '\n' | trim_leading_and_trailing_whitespace)
117
118         deps_documented=$(awk -F'?' '/Have all project dependencies requests on other projects/,/been acknowledged and documented by upstream projects/ {print $2}' "$f" | tr -d '\n' | trim_leading_and_trailing_whitespace)
119         features_require_system_test=$(awk -F'?' '/have top-level features not requiring system test/ {print $2}' "$f" | trim_leading_and_trailing_whitespace)
120         use_odl_ci=$(awk -F'?' '/use the OpenDaylight CI infrastructure for testing/,/top-level features requiring system test/ {print $2}' "$f" | tr -d '\n' | trim_leading_and_trailing_whitespace)
121
122         echo "   * - $project" | trim_trailing_whitespace
123         echo "     - :name: $ptl_name" | trim_trailing_whitespace
124         echo "       :email: $ptl_email" | trim_trailing_whitespace
125         echo "       :irc: $ptl_irc" | trim_trailing_whitespace
126         echo "     - :name: $pc_name" | trim_trailing_whitespace
127         echo "       :email: $pc_email" | trim_trailing_whitespace
128         echo "       :irc: $pc_irc" | trim_trailing_whitespace
129         echo "     - :name: $tc_name" | trim_trailing_whitespace
130         echo "       :email: $tc_email" | trim_trailing_whitespace
131         echo "       :irc: $tc_irc" | trim_trailing_whitespace
132         echo "     - :name: $dc_name" | trim_trailing_whitespace
133         echo "       :email: $dc_email" | trim_trailing_whitespace
134         echo "       :irc: $dc_irc" | trim_trailing_whitespace
135         echo "     - $prior_milestone_updates" | trim_trailing_whitespace
136         echo "     - $delivered_milestone_deliverables" | trim_trailing_whitespace
137         echo "     - $ci_needs" | trim_trailing_whitespace
138         echo "     - $release_plan_finalized" | trim_trailing_whitespace
139         echo "     - :short-name: $api_shortname" | trim_trailing_whitespace
140         echo "       :interfaces: $api_interfaces_listed" | trim_trailing_whitespace
141         echo "       :labeled: $api_labeled" | trim_trailing_whitespace
142         echo "       :features: $api_features_identified" | trim_trailing_whitespace
143         echo "     - $deps_documented" | trim_trailing_whitespace
144         echo "     - $features_require_system_test" | trim_trailing_whitespace
145         echo "     - $use_odl_ci" | trim_trailing_whitespace
146     done
147 } > "$MILESTONE_STATUS_DIR/m1.rst"