@@ -23,7 +23,8 @@ class JsmContainer implements Container {
23
23
long jvmMaxRam = 6000
24
24
25
25
private String debugPort // Contains the port used for JVM debug
26
- ArrayList<String > jvmSupportRecommendedArgs = [] // Used for setting application properties: https://confluence.atlassian.com/adminjiraserver/setting-properties-and-options-on-startup-938847831.html
26
+ ArrayList<String > jvmSupportRecommendedArgs = []
27
+ // Used for setting application properties: https://confluence.atlassian.com/adminjiraserver/setting-properties-and-options-on-startup-938847831.html
27
28
28
29
JsmContainer (String dockerHost = " " , String dockerCertPath = " " ) {
29
30
if (dockerHost && dockerCertPath) {
@@ -37,6 +38,7 @@ class JsmContainer implements Container {
37
38
*/
38
39
void enableJvmDebug (String portNr = " 5005" ) {
39
40
41
+
40
42
assert ! created: " Error, cant enable JVM Debug for a container that has already been created"
41
43
debugPort = portNr
42
44
jvmSupportRecommendedArgs + = [" -Xdebug" , " -Xrunjdwp:transport=dt_socket,address=*:${ debugPort} ,server=y,suspend=n" ]
@@ -47,10 +49,28 @@ class JsmContainer implements Container {
47
49
* See: https://jira.atlassian.com/browse/JRASERVER-77129
48
50
*/
49
51
void enableAppUpload () {
52
+
53
+ log. info(" Enabling upload of Custom JIRA Apps" )
54
+ if (appAppUploadEnabled){
55
+ log. debug(" \t App upload is already enabled" )
56
+ }
50
57
assert ! created: " Error, cant enable App Upload for a container that has already been created"
51
58
jvmSupportRecommendedArgs + = [" -Dupm.plugin.upload.enabled=true" ]
52
59
}
53
60
61
+ /**
62
+ * Checks if App Upload is enabled for a container that has been created
63
+ * @return
64
+ */
65
+ boolean isAppAppUploadEnabled () {
66
+
67
+ if (! created) {
68
+ return false
69
+ }
70
+ return inspectContainer()?. getConfig()?. env?. toString()?. contains(" -Dupm.plugin.upload.enabled=true" ) ?: false
71
+
72
+ }
73
+
54
74
/**
55
75
* Gets the latest version number from Atlassian Marketplace
56
76
* @return ex: 5.6.0
@@ -116,7 +136,7 @@ class JsmContainer implements Container {
116
136
}
117
137
118
138
if (jvmSupportRecommendedArgs) {
119
- containerCreateRequest. env. add(" JVM_SUPPORT_RECOMMENDED_ARGS=" + jvmSupportRecommendedArgs. join(" " ))
139
+ containerCreateRequest. env. add(" JVM_SUPPORT_RECOMMENDED_ARGS=" + jvmSupportRecommendedArgs. join(" " ))
120
140
}
121
141
122
142
return containerCreateRequest
@@ -129,7 +149,7 @@ class JsmContainer implements Container {
129
149
* @return
130
150
*/
131
151
MountPoint getJiraHomeMountPoint () {
132
- return getMounts(). find {it. destination == " /var/atlassian/application-data/jira" }
152
+ return getMounts(). find { it. destination == " /var/atlassian/application-data/jira" }
133
153
}
134
154
135
155
@@ -145,7 +165,7 @@ class JsmContainer implements Container {
145
165
stopContainer()
146
166
snapshotName = snapshotName ?: shortId + " -clone"
147
167
148
- boolean success = dockerClient. overwriteVolume(snapshotName, jiraHomeMountPoint. name)
168
+ boolean success = dockerClient. overwriteVolume(snapshotName, jiraHomeMountPoint. name)
149
169
if (wasRunning) {
150
170
startContainer()
151
171
}
@@ -166,9 +186,9 @@ class JsmContainer implements Container {
166
186
167
187
if (volumes. size() == 1 ) {
168
188
return volumes. first()
169
- }else if (volumes. isEmpty()) {
189
+ } else if (volumes. isEmpty()) {
170
190
return null
171
- }else {
191
+ } else {
172
192
throw new InputMismatchException (" Error finding snapshot volume:" + snapshotName)
173
193
}
174
194
@@ -190,7 +210,7 @@ class JsmContainer implements Container {
190
210
snapshotName = snapshotName ?: shortId + " -clone"
191
211
192
212
ArrayList<Volume > existingVolumes = dockerClient. getVolumesWithName(snapshotName)
193
- existingVolumes. each {existingVolume ->
213
+ existingVolumes. each { existingVolume ->
194
214
log. debug(" \t Removing existing snapshot volume:" + existingVolume. name)
195
215
dockerClient. manageVolume. rmVolume(existingVolume. name)
196
216
}
@@ -208,16 +228,16 @@ class JsmContainer implements Container {
208
228
* Clone JIRA home volume
209
229
* Container must be stopped
210
230
* @param newVolumeName must be unique
211
- * @param labels, optional labels to add to the new volume
231
+ * @param labels , optional labels to add to the new volume
212
232
* @return
213
233
*/
214
234
Volume cloneJiraHome (String newVolumeName = " " , Map<String , Object > labels = null ) {
215
235
216
236
newVolumeName = newVolumeName ?: shortId + " -clone"
217
237
218
238
labels = labels ?: [
219
- srcContainerId : getId(),
220
- created : System . currentTimeSeconds()
239
+ srcContainerId : getId(),
240
+ created : System . currentTimeSeconds()
221
241
] as Map
222
242
223
243
Volume newVolume = dockerClient. cloneVolume(jiraHomeMountPoint. name, newVolumeName, labels)
0 commit comments