Skip to content

Commit

Permalink
Merge pull request #2130 from saschagrunert/compress-archive-sources
Browse files Browse the repository at this point in the history
Compress release archive sources
  • Loading branch information
k8s-ci-robot authored Jun 18, 2021
2 parents 9b4e431 + 5333511 commit 9c6a9e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/release/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/release/pkg/gcp"
"k8s.io/release/pkg/object"
"sigs.k8s.io/release-utils/command"
"sigs.k8s.io/release-utils/tar"

"sigs.k8s.io/release-utils/util"
)
Expand Down Expand Up @@ -288,10 +289,14 @@ func (a *defaultArchiverImpl) CopyReleaseToBucket(releaseBuildDir, archiveBucket
return errors.Wrap(err, "normalizing destination path")
}

logrus.Infof("Copy %s to %s...", releaseBuildDir, remoteDest)
tarball := releaseBuildDir + ".tar.gz"
logrus.Infof("Compressing %s to %s", releaseBuildDir, tarball)
if err := tar.Compress(tarball, releaseBuildDir); err != nil {
return errors.Wrap(err, "create source tarball")
}

// logrun $GSUTIL -mq cp $dash_args $WORKDIR/* $archive_bucket/$build_dir || true
if err := gcs.RsyncRecursive(releaseBuildDir, remoteDest); err != nil {
logrus.Infof("Copy %s to %s", tarball, remoteDest)
if err := gcs.CopyToRemote(tarball, remoteDest); err != nil {
return errors.Wrap(err, "copying release directory to bucket")
}
return nil
Expand Down

0 comments on commit 9c6a9e0

Please sign in to comment.