@@ -11,14 +11,31 @@ class FraployService(
1111) {
1212 private val frappeCloudService = FrappeCloudService (client = client, credentials = credentials)
1313
14- suspend fun update (source : FraployConfig .Source ): DeployName {
14+ suspend fun update (source : FraployConfig .Source ): DeployName ? {
1515 val releaseGroupName = frappeCloudService.getReleaseGroupName(source.releaseGroupTitle)
1616 val apps = frappeCloudService.getReleaseGroup(releaseGroupName)
1717 val sites = frappeCloudService.getSites(releaseGroupName)
1818
1919 val appUpdates = apps.getUpdates(source.updateRequests)
2020 val siteUpdates = sites.map { it.toUpdate() }.toSet()
2121
22+ if (appUpdates.isEmpty()) {
23+ println (" all apps are already up-to-date. No deployment necessary." )
24+ return null
25+ } else {
26+ println (" App updates:" )
27+ val maxAppNameLength = appUpdates.maxOf { it.app.name.length }
28+ appUpdates.forEach { println (" ${it.app.name.padStart(maxAppNameLength + 4 )} -> ${it.hash} " ) }
29+ println ()
30+ }
31+
32+ println (" Sites at $releaseGroupName (${source.releaseGroupTitle} ):" )
33+ if (siteUpdates.isEmpty())
34+ println (" <no-sites>" )
35+ else
36+ siteUpdates.forEach { println (" ${it.name} " ) }
37+ println ()
38+
2239 val deployName = frappeCloudService.deployAndUpdate(
2340 releaseGroupName = releaseGroupName,
2441 apps = appUpdates,
@@ -66,7 +83,7 @@ class FraployService(
6683
6784 suspend fun run (config : FraployConfig ) {
6885 val service = FraployService (credentials = config.credentials)
69- val deployName = service.update(source = config.source)
86+ val deployName = service.update(source = config.source) ? : return
7087 service.blocking(deployName = deployName, blockingConfig = config.blocking)
7188 }
7289 }
0 commit comments