Skip to content

Commit d852ef3

Browse files
committed
Build: Remove xpack specific run task (#30487)
With the opening of xpack, we still retained a run task within :x-pack:plugin. However, the root level run task also runs with the default distribution. This change removes the extra run task inside xpack in favor of using the root level task, and moves the license/configuration code for run into the main run configuration.
1 parent 10c365b commit d852ef3

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

distribution/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,22 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
312312

313313
task run(type: RunTask) {
314314
distribution = System.getProperty('run.distribution', 'zip')
315+
if (distribution == 'zip') {
316+
String licenseType = System.getProperty("license_type", "basic")
317+
if (licenseType == 'trial') {
318+
setting 'xpack.ml.enabled', 'true'
319+
setting 'xpack.graph.enabled', 'true'
320+
setting 'xpack.watcher.enabled', 'true'
321+
setting 'xpack.license.self_generated.type', 'trial'
322+
} else if (licenseType != 'basic') {
323+
throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "[basic] or [trial].")
324+
}
325+
setting 'xpack.security.enabled', 'true'
326+
setting 'xpack.monitoring.enabled', 'true'
327+
setting 'xpack.sql.enabled', 'true'
328+
setting 'xpack.rollup.enabled', 'true'
329+
keystoreSetting 'bootstrap.password', 'password'
330+
}
315331
}
316332

317333
/**

x-pack/plugin/build.gradle

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,3 @@ integTestCluster {
159159
return tmpFile.exists()
160160
}
161161
}
162-
163-
run {
164-
def licenseType = System.getProperty("license_type", "basic")
165-
if (licenseType == 'trial') {
166-
setting 'xpack.ml.enabled', 'true'
167-
setting 'xpack.graph.enabled', 'true'
168-
setting 'xpack.watcher.enabled', 'true'
169-
setting 'xpack.license.self_generated.type', 'trial'
170-
} else if (licenseType != 'basic') {
171-
throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "]. Must be " +
172-
"[basic] or [trial].")
173-
}
174-
setting 'xpack.security.enabled', 'true'
175-
setting 'xpack.monitoring.enabled', 'true'
176-
setting 'xpack.sql.enabled', 'true'
177-
setting 'xpack.rollup.enabled', 'true'
178-
keystoreSetting 'bootstrap.password', 'password'
179-
}

0 commit comments

Comments
 (0)