Skip to content

Commit

Permalink
feat: remove artifacts before creating (siderolabs#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrynhard authored Nov 21, 2018
1 parent 3b165b3 commit 76217df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func (p *Pipeline) Build(metadata *metadata.Metadata, stages map[string]*stage.S

// extract extracts an artifact from a docker image.
func (p *Pipeline) extract(sha, image string, artifact *stage.Artifact) error {
if err := os.RemoveAll(artifact.Destination); err != nil {
return fmt.Errorf("failed to clean artifact destination: %v", err)
}
argsSlice := [][]string{
{"create", "--name=" + sha, image},
{"cp", sha + ":" + artifact.Source, artifact.Destination},
Expand Down

0 comments on commit 76217df

Please sign in to comment.