Replies: 3 comments 1 reply
-
Hi @patatetom, Use version: '3'
vars:
ROOTFS: /tmp/rootfs
tasks:
default:
cmds:
- task --list
silent: true
test:
desc: this is a test
vars:
PATCH: ./patch.tar.gz
cmds:
- tar xvzf {{.ROOTFS}}
sources:
- '{{.PATCH}}'
generates:
- '{{.ROOTFS}}/myfile'
method: checksum |
Beta Was this translation helpful? Give feedback.
-
thanks for the quick answer @andreynering. it works using here are the three cases : the first one works as expected but not the next two (if I understood the idea of
# Taskfile1.OK.yml
version: '3'
vars:
ROOTFS: ./work/rootfs
tasks:
default:
cmds:
- task --list
silent: true
test:
desc: this is a test
vars:
PATCH: ./patch.tar.gz
cmds:
- tar xvzf {{.PATCH}}
sources:
- '{{.PATCH}}'
generates:
- '{{.ROOTFS}}/myfile'
method: checksum $ rm -rf .task/; rm -rf ./work/; task -t Taskfile1.OK.yml test; task -t Taskfile1.OK.yml test
task: [test] tar xvzf ./patch.tar.gz
./work/
./work/rootfs/
./work/rootfs/myfile
task: Task "test" is up to date
# Taskfile2.KO.yml
version: '3'
vars:
ROOTFS: ./work/rootfs
tasks:
default:
cmds:
- task --list
silent: true
test:
desc: this is a test
vars:
PATCH: ./patch.tar.gz
cmds:
- tar xvzf {{.PATCH}}
sources:
- '{{.PATCH}}'
generates:
- '{{.ROOTFS}}/myfile'
method: timestamp $ rm -rf .task/; rm -rf ./work/; task -t Taskfile2.KO.yml test; task -t Taskfile2.KO.yml test
task: [test] tar xvzf ./patch.tar.gz
./work/
./work/rootfs/
./work/rootfs/myfile
task: [test] tar xvzf ./patch.tar.gz
./work/
./work/rootfs/
./work/rootfs/myfile
# Taskfile3.KO.yml
version: '3'
tasks:
default:
cmds:
- task --list
silent: true
test:
desc: this is a test
cmds:
- tar xvzf ./patch.tar.gz
sources:
- ./patch.tar.gz
generates:
- ./work/rootfs/myfile
method: timestamp $ rm -rf .task/; rm -rf ./work/; task -t Taskfile3.KO.yml test; task -t Taskfile3.KO.yml test
task: [test] tar xvzf ./patch.tar.gz
./work/
./work/rootfs/
./work/rootfs/myfile
task: [test] tar xvzf ./patch.tar.gz
./work/
./work/rootfs/
./work/rootfs/myfile regards, lacsaP. |
Beta Was this translation helpful? Give feedback.
-
hi @andreynering, |
Beta Was this translation helpful? Give feedback.
-
hi,
I try for the first time
task
and I can't get it to do what I want.here is the configuration file I use :
cmds
runs correctly butsources
(andgenerates
) is not taken into account and the task is executed again when it is restarted.the
.task
folder is not created whatever themethod
used.I tried
vars
but can't use it afterwards : I always get an error when I runtask
.the patch being repeated several times (
cmds
,sources
, etc...) and being able to change in the future, I wish to use a substitute.thanks for your help, regards, lacsaP.
Beta Was this translation helpful? Give feedback.
All reactions