You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Nmcp: timeout while waiting for the deployment $deploymentId to publish. You might need to check the deployment on the Central Portal UI (see $baseUrl$), or you could increase the wait timeout (the current timeout is $timeout)."
79
+
val timeout1 = validationTimeoutSeconds?.seconds ?:10.minutes
80
+
if (timeout1.isPositive()) {
81
+
logger.lifecycle("Nmcp: waiting for validation...")
logger.lifecycle("Nmcp: deployment is published.")
90
+
} else {
91
+
logger.lifecycle("Nmcp: deployment is publishing... Check the central portal UI to verify its status.")
86
92
}
87
-
when (val status = verifyStatus(
88
-
deploymentId = deploymentId,
89
-
baseUrl = baseUrl,
90
-
token = token,
91
-
)) {
92
-
UNKNOWN_QUERY_LATER,
93
-
PENDING,
94
-
VALIDATING,
95
-
PUBLISHING-> {
96
-
logger.debug("Deployment status is '$status', will try again in ${pollingInterval.inWholeSeconds}s (${timeout - mark.elapsedNow()} left)...")
97
-
// Wait for the next attempt to reduce the load on the Central Portal API
98
-
Thread.sleep(pollingInterval.inWholeMilliseconds)
99
-
continue
100
-
}
101
-
102
-
VALIDATED-> {
103
-
logger.lifecycle("Deployment has passed validation, publish it manually from the Central Portal UI.")
104
-
break
105
-
}
93
+
} else {
94
+
check(publishingTimeoutSeconds ==null) {
95
+
"Nmcp: 'publishingTimeout' has no effect if 'publishingType' is USER_MANAGED. Either set 'publishingType = AUTOMATIC' or remove 'publishingTimeout'"
96
+
}
97
+
logger.lifecycle("Nmcp: deployment has passed validation, publish it manually from the Central Portal UI.")
98
+
}
99
+
} else {
100
+
logger.lifecycle("Nmcp: deployment is validating... Check the central portal UI to verify its status.")
101
+
}
102
+
}
106
103
107
-
PUBLISHED-> {
108
-
logger.lifecycle("Deployment is published.")
109
-
break
110
-
}
104
+
privatefunwaitFor(
105
+
target:Set<Status>,
106
+
timeout:Duration,
107
+
logger:GLogger,
108
+
deploymentId:String,
109
+
baseUrl:String,
110
+
token:String,
111
+
) {
112
+
val pollingInterval =5.seconds
113
+
val mark = markNow()
114
+
while (true) {
115
+
check(mark.elapsedNow() < timeout) {
116
+
"Nmcp: timeout while checking deployment '$deploymentId'. You might need to check the deployment status on the Central Portal UI (see $baseUrl$), or you could increase the timeout."
117
+
}
111
118
112
-
isFAILED-> {
113
-
error("Deployment has failed:\n${status.error}")
114
-
}
115
-
}
119
+
val status = verifyStatus(
120
+
deploymentId = deploymentId,
121
+
baseUrl = baseUrl,
122
+
token = token,
123
+
)
124
+
if (status isFAILED) {
125
+
error("Nmcp: deployment has failed:\n${status.error}")
126
+
} elseif (status in target) {
127
+
return
128
+
} else {
129
+
logger.lifecycle("Nmcp: deployment status is '$status', will try again in ${pollingInterval.inWholeSeconds}s (${timeout - mark.elapsedNow()} left)...")
130
+
// Wait for the next attempt to reduce the load on the Central Portal API
131
+
Thread.sleep(pollingInterval.inWholeMilliseconds)
132
+
continue
116
133
}
117
134
}
118
135
}
@@ -190,7 +207,7 @@ internal fun Project.registerPublishReleaseTask(
190
207
taskName:String,
191
208
inputFile:Provider<RegularFile>,
192
209
artifactId:Provider<String>,
193
-
spec:CentralPortalOptions
210
+
spec:CentralPortalOptions,
194
211
): TaskProvider<PublishReleaseTask> {
195
212
val defaultPublicationName = artifactId.map { "${project.group}:${it}:${project.version}.zip" }
196
213
return registerPublishReleaseTask(
@@ -201,7 +218,9 @@ internal fun Project.registerPublishReleaseTask(
0 commit comments