3

It seems to me that drone.io does not share parameters across pipeline steps. Is it possible to read the parameters for the plugins from a file, e.g. a directive like "from_file" similar to the already existing "from_secret"? This is how one could use it:

kind: pipeline
name: default

steps:
- name: get_repo_name
  image: alpine
  commands:
  - echo "hello" > .repo_name
- name: docker  
  image: plugins/docker
  settings:
    repo: 
      from_file: .repo_name
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
Maximilian Mordig
  • 1,333
  • 1
  • 12
  • 16

1 Answers1

2

Ability to read input from a file is more the choice of the plugin author, but creating plugins is a pretty simplistic thing as most of your variables just have to be called in as PLUGIN_VARIABLE and you can then offer such things.

To show that some of the plugins do read from file, one such example is drone-github-comment:

steps:
- name: github-comment
  image: jmccann/drone-github-comment:1.2
  settings:
    message_file: file_name.txt
  when:
    status:
    - success
    - failure

FWIW, looking at your example though, it would seem you are looking to pass just the repo_name? These variables are all present in a pipeline depending of course on the runner you are using, but for Docker you get all of these:

hikerspath
  • 106
  • 7