Skip to content

Jenkinsfile cleanup changes#1094

Merged
Arsnael merged 1 commit intoapache:masterfrom
Arsnael:jenkinsfile-changes
Aug 2, 2022
Merged

Jenkinsfile cleanup changes#1094
Arsnael merged 1 commit intoapache:masterfrom
Arsnael:jenkinsfile-changes

Conversation

@Arsnael
Copy link
Copy Markdown
Contributor

@Arsnael Arsnael commented Jul 27, 2022

No description provided.

@Arsnael Arsnael self-assigned this Jul 27, 2022
@Arsnael
Copy link
Copy Markdown
Contributor Author

Arsnael commented Jul 27, 2022

Few things here... I switched to cleanWs() instead of deleteDir(). Rationals => https://stackoverflow.com/questions/54019121/what-is-the-difference-between-deletedir-cleanws-and-wscleanup-in-jenkins-pi

Some comments saying deleteDir() is bad with a docker context. Like it gets confused because the mounted directory went away... Was thinking could that explain why sometimes we get 404 container not found in the build? Workers seems to have the capacity to hold 2 builds at the same time... I don't know if deleteDir() could create those issues by when starting a 2nd build on the worker, it fucks up docker context with the first build running... Anyways it's just a try

On an other note I saw the Cassandra build using it as well in their Jenkinsfile as pre clean step. They don't seem to have a post clean... well if you clean your workspace everytime before building I think it's not necessary to keep it too (specially only in success case)

As well I added skipDefaultCheckout(true) in options because they advice it in the plugin doc: https://plugins.jenkins.io/ws-cleanup/
And I think it makes sense... What we were doing until now was having that automatic checkout done, then cleanup the workspace (so wiping the thing we did before out) and then redoing a checkout in the next step... Then the automatic checkout is useless

Also got rid of deleting james maven deps from m2 folder... I'm not sure that it does any good to our builds so trying without it for now

EDIT: Actually workspaces seem to be proper to each PR so my previous argument is not really valid... But I still think maybe cleanWs is safer and cleaner than deleteDir ? I don't know if Cassandra project has a particular reason behind it but I still think worth a try on our end...

@Arsnael Arsnael merged commit 85f4f6d into apache:master Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants