drone / proposal

Drone Project Design Documents
13 stars 4 forks source link

Make it possible to run a templated pipeline locally #26

Open andrii-kasparevych opened 2 years ago

andrii-kasparevych commented 2 years ago

As a Dev or DevOps I would like to have a possibility to test my template-based pipelines locally using drone exec CLI so that its I'm able to develop templates quicker without the need to change the template on the drone server.

Sample scenario:

I have a folder containing a .drone.yml file (the pipeline) and template.yaml (the template) like below.

.drone.yml

kind: template
load: template.yaml
data:
  input1: hello
  input2: world

template.yaml

kind: pipeline
type: docker
name: default
steps:
 - name: test
   image: alpine
   commands:
   - echo {{ .input.input1 }}
   - echo {{ .input.input2 }}

I open the command line in that folder (e.g. PowerShell) and run drone exec

Expected output

Drone should automatically discover the template file in the same folder and apply it. Or there may be some additional parameter added to the CLI to provide the template, e.g. drone exec --template templateFolder/template.yaml

[test:0] + echo hello
[test:1] hello
[test:2] + echo world
[test:3] world
MarieReRe commented 2 years ago

Hey @andrii-kasparevych Thanks for submitting another proposal we appreciate it. 🚀

We usually review PRs every Tuesday but I will keep you up to date if anything changes.

petarmaric commented 1 year ago

Hi everyone, any updates (planned) here?