blob: be3f60a13676ae8206d2e751967829479726eff4 [file] [log] [blame]
Clint Adams4fd874b2016-01-19 18:17:49 -05001#!/bin/bash -ex
2
3# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
17# This script is intended to be run as a periodic proposal bot job
18# in OpenStack infrastructure, though you can run it as a one-off.
19#
20# In order to function correctly, the environment in which the
21# script runs must have
Clint Adamse3e80512016-02-18 14:46:35 -050022# * a writable doc/source directory relative to the current
23# working directory
24# AND ( (
Clint Adams4fd874b2016-01-19 18:17:49 -050025# * git
26# * all git repos meant to be searched for plugins cloned and
27# at the desired level of up-to-datedness
Clint Adamse3e80512016-02-18 14:46:35 -050028# * the environment variable git_dir pointing to the location
29# * of said git repositories
30# ) OR (
31# * network access to the review.openstack.org Gerrit API
Clint Adams4fd874b2016-01-19 18:17:49 -050032# working directory
Clint Adamse3e80512016-02-18 14:46:35 -050033# * network access to https://git.openstack.org/cgit
34# ))
Clint Adams4fd874b2016-01-19 18:17:49 -050035#
36# If a file named data/devstack-plugins-registry.header or
37# data/devstack-plugins-registry.footer is found relative to the
38# current working directory, it will be prepended or appended to
39# the generated reStructuredText plugins table respectively.
40
41(
42declare -A plugins
43
Clint Adamsf3b6feb2016-03-07 01:52:35 -050044if [[ -r data/devstack-plugins-registry.header ]]; then
45 cat data/devstack-plugins-registry.header
46fi
Clint Adams4fd874b2016-01-19 18:17:49 -050047
Clint Adams8ce3faf2016-02-26 08:18:13 -070048sorted_plugins=$(python tools/generate-devstack-plugins-list.py)
Clint Adams4fd874b2016-01-19 18:17:49 -050049
Clint Adams8ce3faf2016-02-26 08:18:13 -070050for k in ${sorted_plugins}; do
Clint Adamsbb40df52016-03-01 18:12:48 -050051 project=${k:0:28}
Clint Adams8ce3faf2016-02-26 08:18:13 -070052 giturl="git://git.openstack.org/openstack/${k:0:26}"
Clint Adamsbb40df52016-03-01 18:12:48 -050053 printf "|%-28s|%-73s|\n" "${project}" "${giturl}"
54 printf "+----------------------------+-------------------------------------------------------------------------+\n"
Clint Adams8ce3faf2016-02-26 08:18:13 -070055done
Clint Adams4fd874b2016-01-19 18:17:49 -050056
Clint Adamsf3b6feb2016-03-07 01:52:35 -050057if [[ -r data/devstack-plugins-registry.footer ]]; then
58 cat data/devstack-plugins-registry.footer
59fi
Clint Adams4fd874b2016-01-19 18:17:49 -050060) > doc/source/plugin-registry.rst
Clint Adamse6f0d8c2016-02-26 08:25:32 -070061
62if [[ -n ${1} ]]; then
63 cp doc/source/plugin-registry.rst ${1}/doc/source/plugin-registry.rst
64fi