keyval-resource
keyval-resource copied to clipboard
Add another example for better clarity
I might have a problem with understanding the provided example, it is not entirely clear to me how to write to the properties file. Based on my understanding, I came up with the following pipeline:
jobs:
- name: job1
plan:
- get: source-repo
trigger: false
- task: get-version
config:
platform: linux
image_resource:
type: registry-image
source:
repository: node
tag: 16
inputs:
- name: source-repo
run:
path: sh
args:
- -cx
- |
mkdir keyvalout
echo tag=123 > keyvalout/keyval.properties
- put: keyval
params:
file: keyvalout/keyval.properties
- name: job2
plan:
- in_parallel:
- get: keyval
passed: [job1]
- task: list-files
config:
platform: linux
image_resource:
type: registry-image
source:
repository: node
tag: 16
inputs:
- name: source-repo
run:
path: sh
args:
- -cx
- |
ls -lah keyvalout
cat keyvalout/keyval.properties
...but the keyval-resource doesn't work giving me this error:
reading input file /tmp/build/put/keyvalout/keyval.properties
2021/08/18 16:40:12 open /tmp/build/put/keyvalout/keyval.properties: no such file or directory
I'm pretty sure the resource works, I'm just not able to use it correctly with the example provided.