[Build] Add "run container step" to run arbitrary container (OD-489)
Marcos de Oliveira opened 4 years ago

It would be nice if we could have a step type that allowed us to run containers with unchanged entrypoints (not setting it to sh, or other shell) and have the ability to pass environment variables to the containers (like docker -e). That would allow us to use Drone/Woodpecker/Vela plugins, as they are just containers with specific entrypoints configured by environment variables, like:

  • CI_* for Woodpecker
  • DRONE_* for Drone and
  • PARAMETER_* for Vela

You would not need to support those plugins, as they are written for different tools, but allowing users to run container's entrypoint unchanged and passing environment variable would already allow us to use it and write our own plugins for using with Onedev.

Additionally, if you want to, you could write a guide and have your own config style for plugins in Onedev's build spec, like:

Drone uses a settings array, that internally, get converted to environment like:

- name: notify
  image: plugins/slack
  settings:
    channel: developers
    username: drone

Get converted to DRONE_CHANNEL=developers and DRONE_USERNAME=drone

Similarly, Woodpekcer (a Drone fork) convert settings array to CI_* env vars. Vela do the same thing but name the array as parameters instead of settings. So, additionally to environment variables input field, Onedev could have a settings field in the build spec that gets passed to containers as something like ONEDEV_USERNAME=onedev.

  • Robin Shen commented 4 years ago

    Thanks for the idea. Will explore the approach of using entrypoint/environment combo. As to OneDev style docker container plugin, I do plan to add that, in a more advanced way, that is, instead of using a simple setting array, the plugin can leverage OneDev's typed parameter system as currently used as job parameters to make the plugin much easier to use.

  • Robin Shen changed title 4 years ago
    Previous Value Current Value
    [Build] Add "container plugin" step type
    [Build] Add "run container step" to run arbitrary container
  • OneDev changed state to 'Closed' 4 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 4 years ago

    State changed as code fixing the issue is committed

  • OneDev changed state to 'Released' 4 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 4 years ago

    State changed as build #2193 is successful

issue 1/1
Type
New Feature
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
OD-489
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover