Skip to content

Load PLUGIN_ENV_FILE before app is run #112

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

Merged
merged 1 commit into from
Feb 24, 2018

Conversation

joshdk
Copy link
Contributor

@joshdk joshdk commented Feb 24, 2018

No description provided.

@codecov-io
Copy link

codecov-io commented Feb 24, 2018

Codecov Report

Merging #112 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #112   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         103    103           
=====================================
  Hits          103    103

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84cb184...fcffdc4. Read the comment docs.

@joshdk
Copy link
Contributor Author

joshdk commented Feb 24, 2018

As a preface, I have a Drone build use-case which provisions an external VM in one step, then runs commands on that host in subsequent steps. Part of the problem with this is that the address of the VM is dynamic and not know until after the machine is provisioned. And can not be hardcoded into .drone.yml.

To work around this, the VM provisioner writes PLUGIN_HOST=<random endpoint> to /drone/.env, and then I can then configure env_file: /drone/.env in my .drone.yml.

My PR takes direct inspiration from drone-plugins/drone-docker#89, including its security downsides. Im not sure if your collective opinion on this type of change has changed since then. Alternate solutions would include adding a host_file, a port_file, a ..._file, etc; which seemed sub-optimal.

In the event that there is a more idiomatic workaround, please let me know. And also, thank you for writing a fantastic plugin!

@appleboy appleboy merged commit f92f762 into appleboy:master Feb 24, 2018
@joshdk joshdk deleted the feature/preload-env-file branch February 26, 2018 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants