TEH EMPRAH
TEH EMPRAH

Reputation: 2058

Jenkins - previous build artifacts are lost

So, what I'm doing:

Build n:

  1. Cleaning a MODULE_NAME/test-output/* in workspace explicitly with ant

  2. Running build and tests, getting some artifacts into folder from step one

  3. Jenkins runs archive artifacts step for MODULE_NAME/test-output/*

  4. Now artifacts are stored in build n - works for me.

Now build n+1 launching:

  1. Cleaning a MODULE_NAME/test-output/* in workspace explicitly with ant

  2. Checking artifacts from build n - they're still there, as expected.

  3. Running build and tests, getting some artifacts into workspace folder from step one...

  4. Jenkins runs archive artifacts step for MODULE_NAME/test-output/*

  5. Now artifacts are stored in build n+1 - works for me, if not the next.

The problems is that, for some reason, artifacts from build n are lost.

My post-build actions:

Any suggestions?

How do I keep unique artifacts for each build?

Upvotes: 0

Views: 1664

Answers (2)

Anni S
Anni S

Reputation: 2026

It is happening because in Max # you mentioned 1 so it'll clean artifacts after 1 build either increase that number or just uncheck "Discard Old Builds". You can write some post build script which will clear these artifacts after certain builds.

Upvotes: 0

TEH EMPRAH
TEH EMPRAH

Reputation: 2058

Actually, the problem that bothered us for so long was in here: facepalm.pdf

Not sure if I recall this in older versions of jenkins.

I'm so confused.

Upvotes: 1

Related Questions