aboutsummaryrefslogtreecommitdiff
path: root/deployment
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2020-03-15 19:10:21 +0000
committerMenny Even Danan <menny@evendanan.net>2020-03-15 21:37:34 +0000
commit33188df76e30bcb9506668dd8cbdaa331d8e2573 (patch)
tree87c0816dd1b817c3e9da473fbfd42deae02ba976 /deployment
parentcd5e733a4d3e03cd962630b870132acd0cd0496f (diff)
downloadAnySoftKeyboard-33188df76e30bcb9506668dd8cbdaa331d8e2573.tar.gz
AnySoftKeyboard-33188df76e30bcb9506668dd8cbdaa331d8e2573.tar.bz2
fix promote script and support halt-publishing
Diffstat (limited to 'deployment')
-rw-r--r--deployment/build.gradle62
1 files changed, 49 insertions, 13 deletions
diff --git a/deployment/build.gradle b/deployment/build.gradle
index a44513aed..2993b7dff 100644
--- a/deployment/build.gradle
+++ b/deployment/build.gradle
@@ -10,40 +10,76 @@ deployments {
imeProduction {
environmentSteps = ['production_010', 'production_020', 'production_030', 'production_040', 'production_050', 'production_075', 'production_100']
}
- addOns {
- environmentSteps = ['beta_100', 'production_050', 'production_100']
+
+ addOnsMaster {
+ environmentSteps = ['beta_100']
+ }
+ addOnsProduction {
+ environmentSteps = ['production_010', 'production_050', 'production_100']
}
}
// start - IME
-tasks.register("imeOnMasterPush").configure {
+def imeOnMasterPush = tasks.register("imeOnMasterPush").configure {
it.group "Publishing"
it.description "Deployment request on master push for IME"
it.dependsOn tasks.named("deploymentRequest_imeMaster_alpha_100")
}
-tasks.register("imePromoteMaster").configure {
+def imePromoteMaster = tasks.register("imePromoteMaster").configure {
it.group "Publishing"
it.description "Deployment promoting request on master for IME"
//promoting ime only on Wednesday
- it.onlyIf {
- Instant.now().toCalendar().toDayOfWeek() == DayOfWeek.WEDNESDAY
+ def shouldPromote = Instant.now().toCalendar().toDayOfWeek() == DayOfWeek.WEDNESDAY
+ it.onlyIf { shouldPromote }
+ if (shouldPromote) {
+ it.dependsOn tasks.named("deploymentRequest_imeMaster_beta_100")
}
- it.dependsOn tasks.named("deploymentRequest_imeMaster_beta_100")
}
//TODO: release branch flows
// end - IME
// start - addons
-tasks.register("addOnsOnMasterPush").configure {
+def addOnsOnMasterPush = tasks.register("addOnsOnMasterPush").configure {
it.group "Publishing"
it.description "Deployment request on master push for all addons"
- it.dependsOn tasks.named("deploymentRequest_addOns_beta_100")
+ it.dependsOn tasks.named("deploymentRequest_addOnsMaster_beta_100")
}
-tasks.register("addOnsPromoteMaster").configure {
- it.group "Publishing"
- it.description "NO-OP: Deployment request on master push for all addons"
- //it.dependsOn tasks.named("deploymentRequest_addOns_beta_100")
+
+def addOnsPromoteMaster = tasks.register("addOnsPromoteMaster").configure {
+ it.group 'Publishing'
+ it.description 'NO-OP: Deployment request on master push for all addons'
}
//TODO: release branch flows
// end - addons
+
+tasks.register('deploymentRequestProcess').configure {
+ it.group = 'Publishing'
+ it.description = 'Performs the required deployment flow'
+ 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.')
+ } else {
+ if (ref != null && newDeploy != null) {
+ def imeDeploy
+ def addOnsDeploy
+ if (ref == 'master') {
+ if (newDeploy == 'true') {
+ imeDeploy = imeOnMasterPush
+ addOnsDeploy = addOnsOnMasterPush
+ } else if (newDeploy == 'false') {
+ imeDeploy = imePromoteMaster
+ addOnsDeploy = addOnsPromoteMaster
+ }
+ }
+
+ if (imeDeploy == null || addOnsDeploy == null) {
+ throw new IllegalStateException("Deployment flow for ref ${ref} and new-deploy ${newDeploy}.")
+ }
+
+ it.dependsOn imeDeploy, addOnsDeploy
+ }
+ }
+}