Create file using garden task
# 🌱|help-and-getting-started
c
Hi Team, Is it possible to create the file inside the pod using garden task? - name: tiger-mock-task cacheResult: false command: - /bin/sh - -c - echo "Hello, Garden.io!" > __files/phUIWeb/authentication/file.txt dependencies: - tiger-mock timeout: 100 task executed successfully. but inside the pod i am not able to see that file.txt
c
Hi @chilly-beard-31233, when you run a task the way you configured it, Garden will spin up a new pod to execute said task from that pod. So the file probably got created but not on the pod you were expecting. What you could do is using a
kubernetes-exec
action (I am assuming you are on 0.13.x):
Copy code
kind: Run
type: kubernetes-exec
name: tiger-mock-task
description: a description
dependencies: [deploy.tiger-mock]
spec:
  resource:
    kind: Deployment
    name: tiger-mock # or your pod deployment
  command: ["echo", "'Hello, Garden.io!' > __files/phUIWeb/authentication/file.txt"]
Here's some docs where you can find all the options: https://docs.garden.io/reference/action-types/run/kubernetes-exec
c
let me go through it.. thanks for reference
c
Hi @chilly-beard-31233 did you make it work?