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

Execute custom scripts to be committed #5004

Closed
tschuchortdev opened this issue Dec 16, 2019 · 5 comments
Closed

Execute custom scripts to be committed #5004

tschuchortdev opened this issue Dec 16, 2019 · 5 comments
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people self-hosted Specific to self-hosted users only type:feature Feature (new functionality)

Comments

@tschuchortdev
Copy link

Which Renovate are you using? x the right box:

Renovate Open Source CLI

Which platform are you using? x the right box:

GitLab self-hosted

What is your Question?

Is it possible to execute a custom script in the repository before/after renovate commits the dependency updates? Use case is I want to update the project build version automatically as well, so that the CI pipeline can publish the artifact with a new version.

@rarkins
Copy link
Collaborator

rarkins commented Dec 16, 2019

Currently not possible, and it would require even more steps if it's something that you require to be committed. I'll transfer this to the main repo as a feature request, but it could really benefit from a longer description of your use case.

@rarkins rarkins transferred this issue from renovatebot/config-help Dec 16, 2019
@rarkins rarkins changed the title [Question] Is it possible to execute custom scripts? Execute custom scripts to be committed Dec 16, 2019
@rarkins rarkins added type:feature Feature (new functionality) needs-requirements priority-4-low Low priority, unlikely to be done unless it becomes important to more people self-hosted Specific to self-hosted users only labels Dec 16, 2019
@tschuchortdev
Copy link
Author

My use case:

We have a self-hosted gitlab CI pipeline that tries to publish a maven artifact automatically on commit to master. All development happens on feature branches before being merged to master. Naturally the same artifact version can not be published twice (and we want to avoid relying on SNAPSHOTs for reproducability reasons), so it is the developer's responsibility to increase the version number in the build file when they make a pull request. We would like renovate to call a script that does this increasing of the build version number so that the renovate PR can be merged automatically and the pipeline can publish the changes.

@rarkins
Copy link
Collaborator

rarkins commented Dec 16, 2019

We have a similar “native” feature for npm called bumpVersion. Could this be adapted to support Maven too?

@tschuchortdev
Copy link
Author

The build system that we use is SBT, it just uses a maven repository. IIRC Maven is all dumb XML, so it shouldn't be too hard. SBT files on the other hand are more or less regular Scala code, so it's not as easy to update the version number in a general way since it could be hidden behind other functions and variables (the same is true for Gradle and a number of other build systems as well). Usually the version number is hard coded so we would just do a simple regex replace on the file. However that's kinda hacky and not something I'd be comfortable making official.
I think making it possible to execute arbitrary scripts at different points of the renovate lifecycle would be the most flexible solution. You can't accommodate everyone with a one-size-fits-all configuration.

A simple solution could be to add the option for a script that is executed on cloning a repository. This could be used to symlink other scripts in the repository into the .git/hooks folder and be able to change files in pre-/post-commit hooks, though that's not very user friendly.

@rarkins rarkins closed this as completed Jun 7, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-4-low Low priority, unlikely to be done unless it becomes important to more people self-hosted Specific to self-hosted users only type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants