aboutsummaryrefslogtreecommitdiff
path: root/deployment/build.gradle
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2020-03-15 21:37:11 +0000
committerMenny Even Danan <menny@evendanan.net>2020-03-15 21:37:34 +0000
commit0b264736fbdb17fb8128e4c97fd633e1e6a15617 (patch)
tree1d6b108fc21c3ffc0810c76cd30ae170d128c3d5 /deployment/build.gradle
parentb42440066fdf0e06fb3ba09e753d324589ba6ed9 (diff)
downloadAnySoftKeyboard-0b264736fbdb17fb8128e4c97fd633e1e6a15617.tar.gz
AnySoftKeyboard-0b264736fbdb17fb8128e4c97fd633e1e6a15617.tar.bz2
Printing the reason for halting deployment
Diffstat (limited to 'deployment/build.gradle')
-rw-r--r--deployment/build.gradle20
1 files changed, 18 insertions, 2 deletions
diff --git a/deployment/build.gradle b/deployment/build.gradle
index 2993b7dff..438a82cf8 100644
--- a/deployment/build.gradle
+++ b/deployment/build.gradle
@@ -3,6 +3,22 @@ import java.time.Instant
apply plugin: 'anysoftkeyboard-deployment'
+// If halting deployments is needed, create a file named 'halt_deployment_marker' in this module
+// and write the reason for halting in the file
+File haltDeploymentFile = project.file('halt_deployment_marker')
+
+String skipDeploymentReason = ""
+if (haltDeploymentFile.exists()) {
+ if (haltDeploymentFile.length() == 0 || haltDeploymentFile.readLines()
+ .stream()
+ .map { l -> l.trim() }
+ .allMatch { l -> l.empty }) {
+ throw new IllegalStateException("${haltDeploymentFile.name} marker file must contain a reason.")
+ }
+ skipDeploymentReason = "****** NOTE: Marker file '${haltDeploymentFile.name}' found. Skipping. Reason: '${haltDeploymentFile.text.trim()}'"
+ println(skipDeploymentReason);
+}
+
deployments {
imeMaster {
environmentSteps = ['alpha_100', 'beta_100']
@@ -59,8 +75,8 @@ tasks.register('deploymentRequestProcess').configure {
String ref = project.findProperty('Request.ref')
String newDeploy = project.findProperty('Request.new_deploy')
- if (project.file('halt_deployment_marker').exists()) {
- println('Marker file halt_deployment_marker found. Skipping.')
+ if (!skipDeploymentReason.empty) {
+ println(skipDeploymentReason);
} else {
if (ref != null && newDeploy != null) {
def imeDeploy