gvsig-raster / org.gvsig.raster / tags / org.gvsig.raster-2.2.5 / closeVersions @ 22479
History | View | Annotate | Download (5.4 KB)
1 | 2740 | nbrodin | #/bin/bash |
---|---|---|---|
2 | 2577 | nbrodin | #Pasos: |
3 | 2740 | nbrodin | #1:Comprobar los números de versión de las variables y el password |
4 | #2:Comprobar que los buildnumber de los proyectos son correctos y están commitados |
||
5 | 2577 | nbrodin | #3:Ejecutar este script |
6 | 2740 | nbrodin | #4:Subir los instaladores que estarán dice $HOME/.gvsig-devel.properties |
7 | 2577 | nbrodin | |
8 | 2740 | nbrodin | INCREMENT=3 #1:major number 2:minor number 3:bug number |
9 | USER= |
||
10 | PASS= |
||
11 | 2733 | nbrodin | |
12 | 2577 | nbrodin | LIBRARIES="org.gvsig.raster.cache org.gvsig.toolbox" |
13 | MULTIPLAT_PLUGINS="org.gvsig.raster org.gvsig.raster.gdal org.gvsig.raster.ermapper org.gvsig.raster.lizardtech" |
||
14 | ALLPLAT_PLUGINS="org.gvsig.geoprocess org.gvsig.raster.tilecache org.gvsig.raster.tools org.gvsig.raster.georeferencing org.gvsig.raster.multifile org.gvsig.raster.netcdf org.gvsig.raster.osm org.gvsig.raster.postgis org.gvsig.raster.principalcomponents org.gvsig.raster.reproject org.gvsig.raster.wcs org.gvsig.raster.wms org.gvsig.raster.wmts" |
||
15 | |||
16 | WORKSPACE=. #QUITAR EN JENKINS |
||
17 | LOG=$HOME"/log-closeversions-"`date +%d%m%Y%H%M`".txt" |
||
18 | |||
19 | S0="https://devel.gvsig.org/svn/gvsig-raster" |
||
20 | S1="https://devel.gvsig.org/svn/gvsig-georeferencing" |
||
21 | S2="https://devel.gvsig.org/svn/gvsig-toolbox" |
||
22 | S3="https://devel.gvsig.org/svn/gvsig-osm" |
||
23 | S4="https://devel.gvsig.org/svn/gvsig-geoprocess" |
||
24 | |||
25 | 2840 | cmartinez | PARAMETERS_LIN="-Dnative-platform=linux -Dnative-compiler=gcc4 -Dnative-arch=i386 -Dnative-distribution=all -Dlibrary-type=dynamic -Dnative_classifier=linux-all-gcc4-i386-dynamic -Dnative_classifier=linux-all-gcc4-i386-dynamic -Dmaven.test.skip" |
26 | 2577 | nbrodin | |
27 | 2840 | cmartinez | PARAMETERS_WIN="-Dnative-platform=win -Dnative-compiler=vs8 -Dnative-arch=i386 -Dnative-distribution=win -Dlibrary-type=dynamic -Dnative_classifier=win-nt-vs8-i386-dynamic -Dnative_classifier=win-nt-vs8-i386-dynamic -Dmaven.test.skip" |
28 | 2577 | nbrodin | |
29 | PLUGINS=$MULTIPLAT_PLUGINS" "$ALLPLAT_PLUGINS |
||
30 | PROJECTS=$LIBRARIES" "$PLUGINS |
||
31 | |||
32 | LIBRARIES_SERVER=($S0 $S2) |
||
33 | MULTIPLAT_PLUGINS_SERVER=($S0 $S0 $S0 $S0) |
||
34 | ALLPLAT_PLUGINS_SERVER=($S4 $S0 $S0 $S1 $S0 $S0 $S3 $S0 $S0 $S0 $S0 $S0 $S0) |
||
35 | PLUGINS_SERVER=("${MULTIPLAT_PLUGINS_SERVER[@]}" "${ALLPLAT_PLUGINS_SERVER[@]}") |
||
36 | PROJECTS_SERVER=("${LIBRARIES_SERVER[@]}" "${PLUGINS_SERVER[@]}") |
||
37 | |||
38 | |||
39 | #****************************************** |
||
40 | # Checkout |
||
41 | #****************************************** |
||
42 | |||
43 | cont=0; |
||
44 | for i in $PROJECTS; |
||
45 | do |
||
46 | 2740 | nbrodin | # svn checkout ${PROJECTS_SERVER[cont]}"/"$i"/trunk/"$i |
47 | echo ${PROJECTS_SERVER[cont]}"/"$i"/trunk/"$i |
||
48 | # cont=$((cont+1)) |
||
49 | 2577 | nbrodin | done |
50 | |||
51 | 2740 | nbrodin | #exit; |
52 | 2577 | nbrodin | |
53 | #****************************************** |
||
54 | # Clean |
||
55 | #****************************************** |
||
56 | |||
57 | 2740 | nbrodin | echo "Cleaning..."$PROJECTS |
58 | 2577 | nbrodin | for i in $PROJECTS; |
59 | do |
||
60 | 2740 | nbrodin | if [ ! -d $WORKSPACE/$i ]; |
61 | then |
||
62 | continue; |
||
63 | fi |
||
64 | echo "Cambiando a..."$WORKSPACE/$i >> $LOG |
||
65 | 2577 | nbrodin | cd $WORKSPACE/$i |
66 | 2740 | nbrodin | #mvn clean >> $LOG |
67 | #mvn release:clean >> $LOG |
||
68 | 2577 | nbrodin | cd .. |
69 | done |
||
70 | |||
71 | 2740 | nbrodin | #exit; |
72 | |||
73 | #****************************************** |
||
74 | # Increase build number |
||
75 | #****************************************** |
||
76 | |||
77 | if [ "$1" == "increasebn" ]; |
||
78 | then |
||
79 | for i in `ls`; |
||
80 | do |
||
81 | |||
82 | if [ -d $i ]; |
||
83 | then |
||
84 | cd $i; |
||
85 | mvn compile -Dincrease-build-number; |
||
86 | cd .. |
||
87 | fi |
||
88 | |||
89 | done |
||
90 | fi |
||
91 | |||
92 | #****************************************** |
||
93 | # Commit build number |
||
94 | #****************************************** |
||
95 | |||
96 | if [ "$1" == "commitbn" ]; |
||
97 | then |
||
98 | for i in `ls`; |
||
99 | do |
||
100 | |||
101 | if [ -d $i ]; |
||
102 | then |
||
103 | cd $i; |
||
104 | svn commit -m "New build number"; |
||
105 | cd .. |
||
106 | fi |
||
107 | |||
108 | done |
||
109 | fi |
||
110 | |||
111 | #****************************************** |
||
112 | # Get version |
||
113 | #****************************************** |
||
114 | |||
115 | version() { |
||
116 | VERSION_TO_FIX=`cat pom.xml | grep "<version>" | head -n 1 | sed 's/<version>//g' | sed 's/-SNAPSHOT<\/version>//g'`; |
||
117 | MAJOR_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 1`; |
||
118 | MINOR_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 2`; |
||
119 | BUG_NUMBER=`echo $VERSION_TO_FIX | cut -d"." -f 3`; |
||
120 | |||
121 | if [ $INCREMENT -eq 1 ]; then |
||
122 | MAJOR_NUMBER=$((MAJOR_NUMBER+1)); |
||
123 | fi |
||
124 | |||
125 | if [ $INCREMENT -eq 2 ]; then |
||
126 | MINOR_NUMBER=$((MINOR_NUMBER+1)); |
||
127 | fi |
||
128 | |||
129 | if [ $INCREMENT -eq 3 ]; then |
||
130 | BUG_NUMBER=$((BUG_NUMBER+1)); |
||
131 | fi |
||
132 | |||
133 | NEW_VERSION_VALUE=$MAJOR_NUMBER"."$MINOR_NUMBER"."$BUG_NUMBER"-SNAPSHOT"; |
||
134 | } |
||
135 | |||
136 | |||
137 | 2577 | nbrodin | cont=0 |
138 | for i in $PROJECTS; |
||
139 | do |
||
140 | 2740 | nbrodin | if [ ! -d $WORKSPACE/$i ]; |
141 | then |
||
142 | cont=$((cont+1)) |
||
143 | continue; |
||
144 | fi |
||
145 | |||
146 | 2577 | nbrodin | cd $WORKSPACE/$i |
147 | echo "Cambiando a..."$WORKSPACE/$i >> $LOG |
||
148 | 2740 | nbrodin | |
149 | version |
||
150 | echo $VERSION_TO_FIX |
||
151 | echo $NEW_VERSION_VALUE |
||
152 | 2577 | nbrodin | |
153 | #****************************************** |
||
154 | # Prepare |
||
155 | #****************************************** |
||
156 | |||
157 | 2740 | nbrodin | mvn release:prepare -B -DdryRun=false -Dtag=$VERSION_TO_FIX -DreleaseVersion=$VERSION_TO_FIX -DdevelopmentVersion=$NEXT_VERSION_VALUE -DpreparationGoals="clean install" -Dusername=$USER -Dpassword=$PASS -DignoreSnapshots=true -Darguments=$PARAMETERS_LIN |
158 | 2577 | nbrodin | |
159 | |||
160 | 2740 | nbrodin | read -p "¿Prepare de $i correcto? ¿Continuar? s/n: " CONTINUE |
161 | 2577 | nbrodin | if [ "$CONTINUE" == "n" ]; then |
162 | mvn release:rollback |
||
163 | exit; |
||
164 | fi |
||
165 | |||
166 | #****************************************** |
||
167 | # Perform |
||
168 | #****************************************** |
||
169 | |||
170 | 2740 | nbrodin | mvn release:perform -Dusername=$USER -Dpassword=$PASS -Darguments=$PARAMETERS_LIN |
171 | 2577 | nbrodin | |
172 | 2740 | nbrodin | read -p "¿Perform de $i correcto? ¿Continuar? s/n: " CONTINUE |
173 | 2577 | nbrodin | if [ "$CONTINUE" == "n" ]; then |
174 | mvn release:rollback |
||
175 | exit; |
||
176 | fi |
||
177 | |||
178 | cont=$((cont+1)) |
||
179 | cd .. |
||
180 | done |
||
181 | |||
182 | |||
183 | #****************************************** |
||
184 | # Windows Installer |
||
185 | #****************************************** |
||
186 | |||
187 | cont=0; |
||
188 | for i in $MULTIPLAT_PLUGINS; |
||
189 | do |
||
190 | 2740 | nbrodin | #svn checkout ${MULTIPLAT_PLUGINS_SERVER[cont]}"/"$i"/tags/v"${MULTIPLAT_PLUGINS_VERSION[cont]} |
191 | #cd v${MULTIPLAT_PLUGINS_VERSION[cont]} |
||
192 | #mvn install $PARAMETERS_WIN |
||
193 | #cd .. |
||
194 | #rm v${MULTIPLAT_PLUGINS_VERSION[cont]} -rf |
||
195 | 2577 | nbrodin | cont=$((cont+1)) |
196 | 2740 | nbrodin | done |