Documentation tell us we can use docker run to debug, but it doesn’t work for me now. What problem I missed? And how can I get plugin output in drone exec progress?
have you tried setting the HTTPS_PROXY and HTTP_PROXY variables? The telegram plugin is written in Go and therefore will respect these environment variables.
Please make sure you are using version 0.8 of the CLI for testing. Older versions of the CLI did not execute plugins by default, and required a special flag. The latest version of the CLI does not have this requirement. Releases · harness/drone-cli · GitHub
Note that once the plugin executes, drone exec will stream the plugin output (stdout/stderr) to the console.
http_proxy souds great! But I don’t know how set it in drone ci, could you tell me? Thank you~
Sorry I have not tell you some info. Yes, my drone cli version is 0.8.
You do not need to do anything special to display plugin output in the terminal. If your plugin writes to stdout / stderr, drone will automatically stream stdout / stderr using docker logs and will copy the stream to the terminal.
If you do not see anything in the terminal, maybe your plugin is failing? Did you check the exit code of drone exec to see if it returns a non-zero exit code? Also check your docker daemon logs to make sure the plugin container is successfully created and run.
Note that you cannot use commands with a plugin. If you declare commands with a plugin, it will override the default entrypoint and the plugin will not execute.
http_proxy souds great! But I don’t know how set it in drone ci, could you tell me?
you just set the environment variables, like this:
Yes, commands just for my test, I have not set it in my yaml. I want to check docker daemon logs, but plugin runs too quick that container destroy too fast. I’ll try plugin again later, Thank you.
By the way, I can set shell variable http_proxy when run drone exec command. But how can I set it in drone ci during triggered by git commit? can I config all plugins like this without develop?
I have fixed it. The reason why it doesn’t work seems drone run change plugin workdir parameter, so docker can’t find my entrypoint file with relative path. Then no log output because plugin run empty script.