steebchen/kubectl

kubectl command inside kubectl command [YES IT WORKS !!!!] [this is not an issue hihi]

tomtom94 opened this issue · 0 comments

Hello I would like to use kubectl inside your kubectl plugin, because I need to find the pod's name before doing what I want.

The pod name I need : kubectl get pod -l app.kubernetes.io/instance=footballmotion -o jsonpath="{.items[0].metadata.name}"

But you know what ?? it works bro, you can close my issue right away !

Just hope it'll help someone else. Enjoy.

      - name: Copy static files
        uses: steebchen/kubectl@master
        env:
          KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_BASE64 }}
          KUBECTL_VERSION: "1.15"
        with:
          args: '"cp $(kubectl get pod -l app.kubernetes.io/instance=footballmotion -o jsonpath="{.items[0].metadata.name}"):dist/client/static ./static"'

      - name: Past static files
        uses: steebchen/kubectl@master
        env:
          KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_BASE64 }}
          KUBECTL_VERSION: "1.15"
        with:
          args: '"cp ./static $(kubectl get pod -l app.kubernetes.io/instance=staticfiles -o jsonpath="{.items[0].metadata.name}"):."'