I have a script that generates a version string based on the current git commit and history. I want to use that version string for the docker images too. However, I can’t seem to figure out a way to run this script/program and then use its output version with the docker plugin.
The reason this example does not work is because it is not possible at the unix level. One cannot create an environment variable in one process, and read that environment variable in a sibling process. We can reproduce the same results with these shell commands:
If you need to share data between sibling processes (pipeline steps) you need to share this information by writing to and reading from disk. The docker plugin will automatically read tags from a .tags file, which means you can do this:
I’d gladly do that, but I can’t seem to figure out where the docs live. drone/docs doesn’t seem like it, and the plugin repo itself has no docs. Perhaps the pages should link to their source files on GitHub, to make it trivial to find what page to contribute to.