Open sytolk opened 2 years ago
But if your CI environment already has node and npm installed shouldn't you be using download = false
?
If your CI environment has some environment variable set (like CI
) you could use that to set download
to the appropriate value
Yes of course I can switch download = false/true
based on ENV=CI
but this takes time..
download=auto
will skip this checks in build.gradle for different environments (this can be the default option)
An other option is to detect musl for linux alpine and alwayse setdownload = false
with message for devs like -> "We cannot download node musl for this system please install it manually"
I'm not sure why an environment variable check would take time, but I think I can confidently say that implementing that will be faster than building the detection functionality in the plugin.
And currently download = false
just assumes node is on the path and download = true
will just add node to the path, so to add it there would have to be some significant refactoring.
And while I have thought about the musl detection and erroring out, that'd prevent you from using your own internal mirror which could contain musl-compatible builds (and I think there's an unofficial repository which is publicly available and does this already)
Although all of this will be irrelevant if I get the Shared Build Services approach to work (there's some issues related to it)
And while download = auto
is a good idea in general the specifics of the code in the plugin means that it's more work to support than the build service approach (which would have the same effect in the end)
We can have option auto here: https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/usage.md#configuring-the-plugin
look at the comments
In CI environment there is no sense to download node if its already exist. If node exist and its downloaded another version of node from this plugin its have versions conflicts in alpine: https://github.com/node-gradle/gradle-node-plugin/issues/51
for this issue with
download = true
:my temp fix is to set
download = false
and install node manuallyapk add --update nodejs npm