Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r726 - trunk/gerrit_hudson_scripts/gerrit-mirror1.sh

argouml-gen
Discussion topic

Back to topic list

svn commit: r726 - trunk/gerrit_hudson_scripts/gerrit-mirror1.sh

Reply

Author linus
Full name Linus Tolke
Date 2012-05-24 20:59:54 PDT
Message Author: linus
Date: 2012-05-24 20:59:54-0700
New Revision: 726

Modified:
   trunk/gerrit_hudson_​scripts/gerrit-mirro​r1.sh

Log:
Added langauge projects.
Added Jenkins config copying.

Modified: trunk/gerrit_hudson_​scripts/gerrit-mirro​r1.sh
Url: http://argouml-gen.t​igris.org/source/bro​wse/argouml-gen/trun​k/gerrit_hudson_scri​pts/gerrit-mirror1.s​h?view=diff&path​rev=726&r1=725​&r2=726
====================​====================​====================​==================
--- trunk/gerrit_hudson_​scripts/gerrit-mirro​r1.sh (original)
+++ trunk/gerrit_hudson_​scripts/gerrit-mirro​r1.sh 2012-05-24 20:59:54-0700
@@ -14,6 +14,14 @@
 # $ cd <.../site>/git
 # $ <SCRIPT_LOCATION​>/gerrit-mirror1.s​h -i
 #
+# Tell gerrit to reset it's list of projects:
+# $ ssh -p 29418 gerrit-server -l gerrit-user gerrit flush-projects
+#
+# Create a jenkins job name gerrit-<PROJECTNAME> to be used as template
+# As the jenkins user, in the jobs directory
+# $ <SCRIPT_LOCATION​>/gerrit-mirror1.s​h -c <PROJECTNAME>
+# In Jenkins, Reload Configuration from Disk.
+#
 # * Run regularly *
 # As the gerrit user:
 # $ cd <.../site>/git
@@ -43,14 +51,27 @@
               argouml-ruby \
               argouml-sql \
               \
+ argouml-ca \
+ argouml-de argouml-en-gb argouml-es \
+ argouml-fr \
+ argouml-hi \
+ argouml-i18n-zh argouml-it \
+ argouml-ja \
+ argouml-nb \
+ argouml-pt argouml-pt-br \
+ argouml-ro argouml-ru \
+ argouml-sv \
+ argouml-tr \
+ \
               argoprint \
               argopdf \
               argouml-documentation \
           "
 
-set -- `getopt ip "$@"`
+set -- `getopt ipc: "$@"`
 INITIALIZE=false
 STORE_PASSWORDS=false
+CREATE_CI_CONFIG=false
 while true
 do
   case "$1" in
@@ -62,6 +83,18 @@
     STORE_PASSWORDS=true
     shift
     ;;
+ -c)
+ CREATE_CI_CONFIG=true
+ shift
+ TEMPLATE_PROJECT="$1"
+ TEMPLATE_FILE="gerri​t-$1/config.xml"
+ if test ! -f "$TEMPLATE_FILE"
+ then
+ echo The template config file "$TEMPLATE_FILE" does not exist.
+ exit 1;
+ fi
+ shift
+ ;;
   --)
     shift
     break
@@ -108,6 +141,38 @@
   exit 0;
 fi
 
+if $CREATE_CI_CONFIG
+then
+ for proj in $PROJECTS
+ do
+ if test "$TEMPLATE_PROJECT" != "$proj"
+ then
+ PROJECT_FILE="gerrit​-$proj/config.xml"
+ test -d `dirname "$PROJECT_FILE"` || mkdir `dirname "$PROJECT_FILE"`
+ sed "s/$TEMPLATE_PROJECT/$proj/g" < "$TEMPLATE_FILE" > "$PROJECT_FILE".new
+ if test -f "$PROJECT_FILE"
+ then
+ diff "$PROJECT_FILE" "$PROJECT_FILE".new
+ echo -n "Replace? N/Y "
+ read ans
+ case "$ans" in
+ Y)
+ rm "$PROJECT_FILE"
+ mv "$PROJECT_FILE".new "$PROJECT_FILE"
+ ;;
+ *)
+ rm "$PROJECT_FILE".new
+ ;;
+ esac
+ else
+ mv "$PROJECT_FILE".new "$PROJECT_FILE"
+ fi
+ fi
+ done
+ echo Initialization done.
+ exit 0;
+fi
+
 for proj in $PROJECTS
 do
   if test -d $proj

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r726 - trunk/gerrit_hudson_scripts/gerrit-mirror1.sh linus Linus Tolke 2012-05-24 20:59:54 PDT
Messages per page: