woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 351 forks source link

Persisting environment data between steps not working with debian base image #3593

Open micash545 opened 5 months ago

micash545 commented 5 months ago

Component

server

Describe the bug

steps:
  - name: init
    image: debian
    commands:
      - echo "FOO=hello" >> envvars
      - echo "BAR=world" >> envvars

  - name: debug
    image: debian
    commands:
      - source envvars
      - echo $FOO

Output of debig step:

+ source envvars
/bin/sh: 15: source: not found

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"2.3.0"}

Additional context

No response

Validations

zc-devs commented 5 months ago
  1. Use POSIX . envvars;
  2. Or wait for #3269;
  3. Or try to wrap in script:
    - name: debug
    commands:
      - cicd/debug.sh
    image: debian
    #!/bin/bash
    source envvars
    echo $FOO