Add size of the snapshot into the structure
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Adam Štrauch 2021-10-30 13:29:35 +02:00
parent 81bcdcf00c
commit 7616eef12b
Signed by: cx
GPG Key ID: 018304FFA8988F8D
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
return snapshot.KeyName(), fmt.Errorf("compression error: %v", err)
}
info, err := os.Stat(tmpSnapshotArchivePath)
if err != nil {
return snapshot.KeyName(), fmt.Errorf("temporary file stat error: %v", err)
}
snapshot.Labels = append(snapshot.Labels, fmt.Sprintf("size:%d", info.Size()))
// Clean after myself
defer func() {
err = os.Remove(tmpSnapshotArchivePath)