This repository was archived by the owner on Feb 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +47
-9
lines changed Expand file tree Collapse file tree 5 files changed +47
-9
lines changed Original file line number Diff line number Diff line change 125
125
sonarqube::move_to_home { 'extensions' : } ->
126
126
sonarqube::move_to_home { 'logs' : } ->
127
127
128
- # ===== Install Sonar =====
128
+ # ===== Install SonarQube =====
129
129
130
130
exec { 'untar' :
131
131
command => " unzip -o ${tmpzip} -d ${installroot} && chown -R ${user} :${group} ${installroot} /${package_name} -${version} && chown -R ${user} :${group} ${real_home} " ,
159
159
}
160
160
}
161
161
162
+ file { '/tmp/cleanup-old-plugin-versions.sh' :
163
+ content => template (" ${module_name} /cleanup-old-plugin-versions.sh.erb" ),
164
+ mode => ' 0755' ,
165
+ }
166
+ ->
167
+ file { '/tmp/cleanup-old-sonarqube-versions.sh' :
168
+ content => template (" ${module_name} /cleanup-old-sonarqube-versions.sh.erb" ),
169
+ mode => ' 0755' ,
170
+ }
171
+ ->
172
+ exec { 'remove-old-versions-of-sonarqube' :
173
+ command => " /tmp/cleanup-old-sonarqube-versions.sh ${installroot} ${version} " ,
174
+ path => ' /usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin' ,
175
+ }
176
+
162
177
# The plugins directory. Useful to later reference it from the plugin definition
163
178
file { $plugin_dir:
164
179
ensure => directory ,
Original file line number Diff line number Diff line change 36
36
before => File [$plugin ],
37
37
require => File [$sonarqube::plugin_dir ],
38
38
}
39
+ ->
39
40
exec { "remove-old-versions-of-${artifactid}" :
40
- command => " rm -f ${sonarqube::plugin_dir} / ${artifactid} *.jar " ,
41
+ command => " /tmp/cleanup-old-plugin-versions.sh ${sonarqube::plugin_dir} ${artifactid} ${version} " ,
41
42
path => ' /usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin' ,
42
43
}
43
44
->
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ pushd $1
4
+ for file in $( ls | grep $2 )
5
+ do
6
+ if [ " $file " != " $2 -$3 .jar" ]
7
+ then
8
+ rm -f " $file "
9
+ fi
10
+ done
11
+ popd
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ pushd $1
4
+ for directory in $( ls | grep " sonarqube-" )
5
+ do
6
+ if [ " $directory " != " sonarqube-$2 " ]
7
+ then
8
+ rm -rf " $directory "
9
+ fi
10
+ done
11
+ popd
Original file line number Diff line number Diff line change 20
20
# -----------------------------------------------------------------------------
21
21
# These settings can be modified to fit the needs of your application
22
22
23
- # Default values for the Application variables, below.
24
- #
23
+ # Default values for the Application variables, below.
24
+ #
25
25
# NOTE: The build for specific applications may override this during the resource-copying
26
26
# phase, to fill in a concrete name and avoid the use of the defaults specified here.
27
27
DEF_APP_NAME=" sonar"
@@ -313,7 +313,7 @@ checkUser() {
313
313
exit 1
314
314
fi
315
315
fi
316
-
316
+
317
317
if [ " ` $IDEXE -u -n` " = " $RUN_AS_USER " ]
318
318
then
319
319
# Already running as the configured user. Avoid password prompts by not calling su.
@@ -330,7 +330,7 @@ checkUser() {
330
330
then
331
331
if [ " X$1 " != " X" ]
332
332
then
333
- # Resolve the primary group
333
+ # Resolve the primary group
334
334
RUN_AS_GROUP=` groups $RUN_AS_USER | awk ' {print $3}' | tail -1`
335
335
if [ " X$RUN_AS_GROUP " = " X" ]
336
336
then
@@ -416,7 +416,7 @@ console() {
416
416
exit 1
417
417
fi
418
418
}
419
-
419
+
420
420
start () {
421
421
echo " Starting $APP_LONG_NAME ..."
422
422
getpid
@@ -435,9 +435,9 @@ start() {
435
435
echo " Started $APP_LONG_NAME ."
436
436
else
437
437
echo " Failed to start $APP_LONG_NAME ."
438
- fi
438
+ fi
439
439
}
440
-
440
+
441
441
stopit () {
442
442
echo " Stopping $APP_LONG_NAME ..."
443
443
getpid
You can’t perform that action at this time.
0 commit comments