https://garden.io logo
#🌱|help-and-getting-started
Create file using garden task
# 🌱|help-and-getting-started
c

chilly-beard-31233

03/12/2024, 2:03 PM
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

chilly-gigabyte-83853

03/13/2024, 11:03 AM
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

chilly-beard-31233

03/18/2024, 2:51 PM
let me go through it.. thanks for reference
c

chilly-gigabyte-83853

03/26/2024, 12:36 PM
Hi @chilly-beard-31233 did you make it work?