Skip to content

Commit d9ea2fd

Browse files
committed
add rbe --export-only
1 parent 826d1e7 commit d9ea2fd

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

lifecycle/manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ func (lcs *LifecycleServicesManager) ExportReleaseBundle(rbDetails lifecycle.Rel
147147
return rbService.ExportReleaseBundle(rbDetails, modifications, queryParams)
148148
}
149149

150+
func (lcs *LifecycleServicesManager) ExportReleaseBundleOnly(rbDetails lifecycle.ReleaseBundleDetails, modifications lifecycle.Modifications, queryParams lifecycle.CommonOptionalQueryParams) (exportResponse lifecycle.ReleaseBundleExportedStatusResponse, err error) {
151+
rbService := lifecycle.NewReleaseBundlesService(lcs.config.GetServiceDetails(), lcs.client)
152+
return rbService.ExportReleaseBundleOnly(rbDetails, modifications, queryParams)
153+
}
154+
150155
func (lcs *LifecycleServicesManager) IsReleaseBundleExist(rbName, rbVersion, projectKey string) (bool, error) {
151156
rbService := lifecycle.NewReleaseBundlesService(lcs.config.GetServiceDetails(), lcs.client)
152157
return rbService.ReleaseBundleExists(rbName, rbVersion, projectKey)

lifecycle/services/export.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,23 @@ func (rbs *ReleaseBundlesService) ExportReleaseBundle(rbDetails ReleaseBundleDet
9393
return
9494
}
9595

96+
func (rbs *ReleaseBundlesService) ExportReleaseBundleOnly(rbDetails ReleaseBundleDetails, modifications Modifications, queryParams CommonOptionalQueryParams) (exportResponse ReleaseBundleExportedStatusResponse, err error) {
97+
// Check the current status
98+
if exportResponse, err = rbs.getExportedReleaseBundleStatus(rbDetails, queryParams); err != nil {
99+
return
100+
}
101+
if exportResponse.Status == ExportCompleted {
102+
return
103+
}
104+
// Trigger export only, don't wait for completion
105+
if err = rbs.triggerReleaseBundleExportProcess(rbDetails, modifications, queryParams); err != nil {
106+
return
107+
}
108+
// Return current status after triggering export
109+
exportResponse, err = rbs.getExportedReleaseBundleStatus(rbDetails, queryParams)
110+
return
111+
}
112+
96113
func (rbs *ReleaseBundlesService) waitForExport(rbDetails ReleaseBundleDetails, queryParams CommonOptionalQueryParams) (response ReleaseBundleExportedStatusResponse, err error) {
97114
pollingAction := func() (shouldStop bool, responseBody []byte, err error) {
98115
response, err = rbs.getExportedReleaseBundleStatus(rbDetails, queryParams)

0 commit comments

Comments
 (0)