Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins: fix cleanup permission issue #19

Merged
merged 3 commits into from
Nov 29, 2021
Merged

Conversation

Erikvv
Copy link
Collaborator

@Erikvv Erikvv commented Nov 3, 2021

Don't run commands as root so cleanup can take place.

On top of #14 to preempt conflicts.

Fixes #17

@Erikvv Erikvv force-pushed the jenkins-cleanup-permission branch 30 times, most recently from a183af9 to 4f22f62 Compare November 3, 2021 23:38
@Erikvv Erikvv force-pushed the jenkins-cleanup-permission branch 7 times, most recently from 2d8d1ea to ecebe21 Compare November 4, 2021 00:18
@Erikvv Erikvv changed the title WIP: jenkins: fix cleanup permission issue jenkins: fix cleanup permission issue Nov 4, 2021
@Erikvv
Copy link
Collaborator Author

Erikvv commented Nov 4, 2021

@halkyon I wanted to suggest you as reviewer but you're not in the storj-thirdparty org

Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Replace build.sh script by Makefile (god help us) so part of it can be
run on a different platform or container.

The new release contains 2 binaries, one for each of the supported
platforms.

I tested this on a Dragonboard 410c.
}
post {
always {
cleanWs()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post code isn't guaranteed to run due to issues within Jenkins

Copy link
Collaborator Author

@Erikvv Erikvv Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stefan showed me that cleanup is done by https://plugins.jenkins.io/resource-disposer/ but this fails and he has to do it manually, so therefor this PR exists.

What do you suggest? I don't see harm in leaving cleanWs() here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

storj/storj does a delete before running: https://github.com/storj/storj/blob/main/Jenkinsfile.public#L23

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

storj/storj is forced to do that, because it leaves behind files in the workspace with root owner, which can only be removed by the root user.

After this PR uplink-php doesn't have that problem. Normal cleanup should work.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup failed due to a timeout / jenkins crash not due to the permissions part.

@Erikvv Erikvv mentioned this pull request Nov 16, 2021
@Erikvv Erikvv merged commit f2a23b7 into main Nov 29, 2021
@Erikvv Erikvv deleted the jenkins-cleanup-permission branch November 29, 2021 20:39
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.

Jenkins can't clean workspace
3 participants