Skip to content

Commit

Permalink
Integrate release archiver with krel anago
Browse files Browse the repository at this point in the history
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
  • Loading branch information
puerco committed Nov 25, 2020
1 parent 64c2c8f commit f47c1ab
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 219 deletions.
90 changes: 74 additions & 16 deletions pkg/anago/anagofakes/fake_release_impl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion pkg/anago/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ type releaseImpl interface {
PushBranches(pusher *release.GitObjectPusher, branchList []string) error
PushMainBranch(pusher *release.GitObjectPusher) error
NewGitPusher(opts *release.GitObjectPusherOptions) (*release.GitObjectPusher, error)
ArchiveRelease(options *release.ArchiverOptions) error
}

func (d *defaultReleaseImpl) Submit(options *gcb.Options) error {
Expand Down Expand Up @@ -244,6 +245,11 @@ func (d *defaultReleaseImpl) CreateAnnouncement(options *announce.Options) error
return announce.CreateForRelease(options)
}

func (d *defaultReleaseImpl) ArchiveRelease(options *release.ArchiverOptions) error {
// Create a new release archiver
return release.NewArchiver(options).ArchiveRelease()
}

func (d *defaultReleaseImpl) PushTags(
pusher *release.GitObjectPusher, tagList []string,
) error {
Expand Down Expand Up @@ -444,4 +450,20 @@ func (d *DefaultRelease) CreateAnnouncement() error {
return nil
}

func (d *DefaultRelease) Archive() error { return nil }
// Archive stores the release artifact in a bucket along with
// its logs for long term conservation
func (d *DefaultRelease) Archive() error {
// Create a new options set for the release archiver
archiverOptions := &release.ArchiverOptions{
ReleaseBuildDir: filepath.Join(workspaceDir, "src"),
LogFile: d.state.logFile,
BuildVersion: d.options.BuildVersion,
PrimeVersion: d.state.versions.Prime(),
Bucket: d.options.Bucket(),
}

if err := d.impl.ArchiveRelease(archiverOptions); err != nil {
return errors.Wrap(err, "running the release archival process")
}
return nil
}
Loading

0 comments on commit f47c1ab

Please sign in to comment.