1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Replace DRONE_ with CI_ variables in pipeline steps (#427)

Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
  - `CI_*` prefix replaces `DRONE_*`
  - `CI` value is now `woodpecker`
  - `DRONE=true` has been removed
This commit is contained in:
Anbraten
2021-11-25 20:43:31 +01:00
committed by GitHub
parent ff8ad5bb83
commit 063d0bb32a
37 changed files with 437 additions and 1105 deletions

View File

@@ -2,6 +2,7 @@ package pipeline
import (
"context"
"strings"
"time"
"github.com/rs/zerolog/log"
@@ -127,6 +128,13 @@ func (r *Runtime) exec(proc *backend.Step) error {
}
}
// TODO: using DRONE_ will be deprecated with 0.15.0. remove fallback with following release
for key, value := range proc.Environment {
if strings.HasPrefix(key, "CI_") {
proc.Environment[strings.Replace(key, "CI_", "DRONE_", 1)] = value
}
}
if err := r.engine.Exec(r.ctx, proc); err != nil {
return err
}