Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-51523] Delegate artifact lifecycle management to S3
Do not delete any artifacts from Jenkins

Unless a system property is set
  • Loading branch information
carlossg committed May 24, 2018
1 parent dac6602 commit 735de30
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -75,6 +75,8 @@ public final class JCloudsArtifactManager extends ArtifactManager implements Sta

private static final Logger LOGGER = Logger.getLogger(JCloudsArtifactManager.class.getName());

private static boolean DELETE_BLOBS = Boolean.getBoolean(JCloudsArtifactManager.class.getName() + ".deleteBlobs");

private final BlobStoreProvider provider;

private transient String key; // e.g. myorg/myrepo/master/123
Expand Down Expand Up @@ -129,7 +131,7 @@ public void archive(FilePath workspace, Launcher launcher, BuildListener listene

@Override
public boolean delete() throws IOException, InterruptedException {
return delete(provider, getContext().getBlobStore(), getBlobPath(""));
return DELETE_BLOBS ? delete(provider, getContext().getBlobStore(), getBlobPath("")) : false;
}

/**
Expand Down

0 comments on commit 735de30

Please sign in to comment.