Closed brenwell closed 6 years ago
You should look into http://docs.drone.io/manage-secrets/, the injection of the env variables won'T work like that, you inject the env variables into the drone server, but the drone agent starts the build environments and it doesn't inject any env variable available to the server or the agent.
Yep, just found that, sorry for being stupid and wasting your time. Thanks for getting back to me.
While I have you here, Is there a best practise for bumping the version in order to publish?
And I noticed that if there is an existing version the plugin fails silently
Version exists
+ npm --version
time="2018-03-12T10:14:16Z" level=info msg="Specified credentials" email="my@email.com" username=brenwell
time="2018-03-12T10:14:16Z" level=info msg="Writing npmrc" path="/root/.npmrc"
3.10.10
+ npm config set always-auth true
+ npm whoami
brenwell
time="2018-03-12T10:14:19Z" level=info msg="No registry specified in the package.json"
time="2018-03-12T10:14:19Z" level=info msg="Found package.json" name=each-after version=1.0.13
+ npm view each-after versions --json
Version doesn't exist
+ npm --version
time="2018-03-12T10:16:02Z" level=info msg="Specified credentials" email="my@email.com" username=brenwell
time="2018-03-12T10:16:02Z" level=info msg="Writing npmrc" path="/root/.npmrc"
3.10.10
+ npm config set always-auth true
+ npm whoami
brenwell
time="2018-03-12T10:16:05Z" level=info msg="No registry specified in the package.json"
time="2018-03-12T10:16:05Z" level=info msg="Found package.json" name=each-after version=1.0.14
+ npm view each-after versions --json
time="2018-03-12T10:16:06Z" level=info msg="Version not found in the registry"
time="2018-03-12T10:16:06Z" level=info msg="Publishing package"
+ npm publish
+ each-after@1.0.14
I would suggest adding something like
level=info msg="Version found in the registry"
level=info msg="Not Publishing package"
What do you think?
Thanks again
That's something where @donny-dont can give more information I guess.
The npm plugin was written in a way that it would not fail if there was already a version published. Drone by default does not do tag builds so it was expected that most users would just put it in their pipelines which would build on all branches.
If you enable tags you can have it only attempt to push on a tagged build.
But yea I can probably make the logging clearer.
I understand, thanks @donny-dont
@brenwell did https://github.com/drone-plugins/drone-npm/pull/35 solve this for you?
looks good, thanks!
So let's close this as it seems to be resolved.
Hey there, thanks for the lib!
I was hoping you could help me diagnose my issue publishing. It says its not an npm registry but it exists and I have publish 12 versions there. Any ideas??
https://www.npmjs.com/package/each-after
Cheers
.drone.yml
docker-compose.yml
package.json