devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.29k stars 360 forks source link

runtime variables not available in custom pipeline #2850

Open janrito opened 5 months ago

janrito commented 5 months ago

What happened?
Trying to use an image name in a pipeline

→ devspace run-pipeline test --skip-build
info Using namespace 'tmp'
info Using kube context 'minikube'
image

What did you expect to happen instead?
the runtime variable to hold the image name

→ devspace run-pipeline test --skip-build
info Using namespace 'tmp'
info Using kube context 'minikube'
image registry.com/images/example

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: v2beta1
name: tmp

pipelines:
  test:
    run: |-
      echo "image ${runtime.images.example.image}"

images:
  example:
    image: registry.com/images/example
    tags:
      - $(ls | md5)
      - test

Local Environment:

lizardruss commented 5 months ago

@janrito The pipeline function get_image is more reliable for this purpose.

Here's a devspace.yaml that worked for me:

version: v2beta1
name: tmp

pipelines:
  test:
    run: |-
      echo "image $(get_image --only image example)"
images:
  example:
    image: registry.com/images/example
    tags:
      - $(ls | md5)
      - test

This page needs to be updated, since the variable only sometimes works in pipelines.

janrito commented 5 months ago

Thanks! I'll take a look