forked from jfrog/jfrog-cli-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev' into remove_ca_supported_…
…for_tech
- Loading branch information
Showing
13 changed files
with
154 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package lifecycle | ||
|
||
import ( | ||
"fmt" | ||
"github.com/jfrog/jfrog-cli-core/v2/artifactory/utils" | ||
"github.com/jfrog/jfrog-cli-core/v2/utils/config" | ||
"github.com/jfrog/jfrog-client-go/utils/io/fileutils" | ||
"github.com/jfrog/jfrog-client-go/utils/log" | ||
) | ||
|
||
type ReleaseBundleImportCommand struct { | ||
releaseBundleCmd | ||
filePath string | ||
} | ||
|
||
func (rbi *ReleaseBundleImportCommand) ServerDetails() (*config.ServerDetails, error) { | ||
return rbi.serverDetails, nil | ||
} | ||
|
||
func (rbi *ReleaseBundleImportCommand) CommandName() string { | ||
return "rb_import" | ||
} | ||
|
||
func NewReleaseBundleImportCommand() *ReleaseBundleImportCommand { | ||
return &ReleaseBundleImportCommand{} | ||
} | ||
func (rbi *ReleaseBundleImportCommand) SetServerDetails(serverDetails *config.ServerDetails) *ReleaseBundleImportCommand { | ||
rbi.serverDetails = serverDetails | ||
return rbi | ||
} | ||
|
||
func (rbi *ReleaseBundleImportCommand) SetFilepath(filePath string) *ReleaseBundleImportCommand { | ||
rbi.filePath = filePath | ||
return rbi | ||
} | ||
|
||
func (rbi *ReleaseBundleImportCommand) Run() (err error) { | ||
if err = validateArtifactoryVersionSupported(rbi.serverDetails); err != nil { | ||
return | ||
} | ||
artService, err := utils.CreateServiceManager(rbi.serverDetails, 3, 0, false) | ||
if err != nil { | ||
return | ||
} | ||
|
||
exists, err := fileutils.IsFileExists(rbi.filePath, false) | ||
if err != nil { | ||
return | ||
} | ||
if !exists { | ||
return fmt.Errorf("file not found: %s", rbi.filePath) | ||
} | ||
|
||
log.Info("Importing the release bundle archive...") | ||
if err = artService.ImportReleaseBundle(rbi.filePath); err != nil { | ||
return | ||
} | ||
log.Info("Successfully imported the release bundle archive") | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters