From c451a67afb1e36f826b70d81b03980099a4fe691 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 1 Aug 2014 19:07:16 +0200 Subject: [PATCH] Setup for syncing of glossary These files are used by an infra script to sync files from openstack-manuals to security-doc and operations-guide repositories. The file projects-to-sync.txt contains a list of repositories to update and sync-projects.sh handles the copying of files. This is a very simple script to get the job done. implements bp common-glossary-setup Change-Id: I55be62393213a5ea2657face0f6f5f8bed1b982c --- projects-to-sync.txt | 2 ++ tools/sync-projects.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 projects-to-sync.txt create mode 100755 tools/sync-projects.sh diff --git a/projects-to-sync.txt b/projects-to-sync.txt new file mode 100644 index 0000000000..cf6bc3be10 --- /dev/null +++ b/projects-to-sync.txt @@ -0,0 +1,2 @@ +openstack/operations-guide +openstack/security-doc diff --git a/tools/sync-projects.sh b/tools/sync-projects.sh new file mode 100755 index 0000000000..6ff4fe7514 --- /dev/null +++ b/tools/sync-projects.sh @@ -0,0 +1,42 @@ +#!/bin/bash -xe + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +PROJECT_DIR=$1 + +if [ -z "$PROJECT_DIR" ] ; then + echo "Usage: $0 PROJECT_DIR" + exit 1 +fi + +case "$PROJECT_DIR" in + security-doc) + GLOSSARY_SUB_DIR="glossary" + ENT_DIR="security-guide" + ;; + operations-guide) + GLOSSARY_SUB_DIR="doc/glossary" + ENT_DIR="openstack-ops" + ;; + *) + echo "$PROJECT_DIR not handled" + exit 1 + ;; +esac +GLOSSARY_DIR="$PROJECT_DIR/$GLOSSARY_SUB_DIR" + +cp doc/glossary/glossary-terms.xml $GLOSSARY_DIR/ +cp doc/glossary/locale/* $GLOSSARY_DIR/locale/ +sed -i -e 's|"../common/entities/openstack.ent"|"../$ENT_DIR/openstack.ent"|' \ + $GLOSSARY_DIR/glossary-terms.xml +(cd $PROJECT_DIR;git add $GLOSSARY_SUB_DIR)