From 1cbbc660d24ed3e224bacac6cd74d6c8ecc3df3c Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Wed, 8 Jan 2025 16:11:24 -0500 Subject: [PATCH] Explicity specify deployment order for queues and scheduler tasks (#2631) If we deploy Nomulus, we should do that before queues and the scheduler tasks are updated. --- jetty/build.gradle | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/jetty/build.gradle b/jetty/build.gradle index 7946db043c3..b9822d90647 100644 --- a/jetty/build.gradle +++ b/jetty/build.gradle @@ -87,7 +87,7 @@ tasks.register('buildDeployer', Exec) { commandLine 'go', 'build', '-o', "${buildDir}/deployer", 'deployCloudSchedulerAndQueue.go' } -// Once GKE is the only option, we can use the same task in the root project instaead. +// Once GKE is the only option, we can use the same task in the root project instead. tasks.register('deployCloudSchedulerAndQueue') { dependsOn(tasks.named('deployCloudScheduler'), tasks.named('deployQueue')) } @@ -99,6 +99,8 @@ tasks.register('deployCloudScheduler', Exec) { "${rootDir}/core/src/main/java/google/registry/config/files/nomulus-config-${rootProject.environment}.yaml", "${rootDir}/core/src/main/java/google/registry/env/${rootProject.environment}/default/WEB-INF/cloud-scheduler-tasks.xml", rootProject.gcpProject, '--gke' + // Only deploy the tasks after Nomulus itself is deployed. + mustRunAfter(tasks.named('deployToGke')) } tasks.register('deployQueue', Exec) { @@ -108,14 +110,20 @@ tasks.register('deployQueue', Exec) { "${rootDir}/core/src/main/java/google/registry/config/files/nomulus-config-${rootProject.environment}.yaml", "${rootDir}/core/src/main/java/google/registry/env/common/default/WEB-INF/cloud-tasks-queue.xml", rootProject.gcpProject, '--gke' + // Only deploy the queues after Nomulus itself is deployed. + mustRunAfter(tasks.named('deployToGke')) } -tasks.register('deployNomulus', Exec) { - dependsOn('pushNomulusImage', ':proxy:pushProxyImage', 'deployCloudSchedulerAndQueue') +tasks.register('deployToGke', Exec) { + dependsOn('pushNomulusImage', ':proxy:pushProxyImage') configure verifyDeploymentConfig commandLine './deploy-nomulus-for-env.sh', "${rootProject.environment}", "${rootProject.baseDomain}" } +tasks.register('deployNomulus') { + dependsOn('deployToGke', 'deployCloudSchedulerAndQueue') +} + tasks.register('getEndpoints', Exec) { configure verifyDeploymentConfig commandLine './get-endpoints.py', "${rootProject.gcpProject}"