Delete old fallbacks and compatible stuff (#791)

Drop ...
* ... DRONE_ and deprecated pipeline environment vars
* ... deprecated sqlite3 file path
This commit is contained in:
6543 2022-09-01 14:31:12 +02:00 committed by GitHub
parent 6a2b7586e5
commit c79d49c862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 12 deletions

View file

@ -92,7 +92,7 @@ func setupStore(c *cli.Context) (store.Store, error) {
return store, nil return store, nil
} }
// TODO: convert it to a check and fail hard only function in v0.16.0 to be able to remove it in v0.17.0 // TODO: remove it in v1.1.0
// TODO: add it to the "how to migrate from drone docs" // TODO: add it to the "how to migrate from drone docs"
func fallbackSqlite3File(path string) (string, error) { func fallbackSqlite3File(path string) (string, error) {
const dockerDefaultPath = "/var/lib/woodpecker/woodpecker.sqlite" const dockerDefaultPath = "/var/lib/woodpecker/woodpecker.sqlite"
@ -149,9 +149,7 @@ func fallbackSqlite3File(path string) (string, error) {
// file is still at old location // file is still at old location
_, err = os.Stat(dockerOldPath) _, err = os.Stat(dockerOldPath)
if err == nil { if err == nil {
// TODO: use log.Fatal()... in next version log.Fatal().Msgf("found sqlite3 file at old path '%s', please move it to '%s' and update your volume path if necessary", dockerOldPath, dockerDefaultPath)
log.Error().Msgf("found sqlite3 file at deprecated path '%s', please move it to '%s' and update your volume path if necessary", dockerOldPath, dockerDefaultPath)
return dockerOldPath, nil
} }
// file does not exist at all // file does not exist at all

View file

@ -187,7 +187,8 @@ func (m *Metadata) Environ() map[string]string {
"CI_SYSTEM_PLATFORM": m.Sys.Platform, // will be set by pipeline platform option or by agent "CI_SYSTEM_PLATFORM": m.Sys.Platform, // will be set by pipeline platform option or by agent
"CI_SYSTEM_VERSION": version.Version, "CI_SYSTEM_VERSION": version.Version,
"CI_SYSTEM_ARCH": m.Sys.Platform, // TODO: remove after next version // DEPRECATED
"CI_SYSTEM_ARCH": m.Sys.Platform, // TODO: remove after v1.0.x version
} }
if m.Curr.Event == EventTag { if m.Curr.Event == EventTag {
params["CI_COMMIT_TAG"] = strings.TrimPrefix(m.Curr.Commit.Ref, "refs/tags/") params["CI_COMMIT_TAG"] = strings.TrimPrefix(m.Curr.Commit.Ref, "refs/tags/")

View file

@ -206,13 +206,6 @@ func (r *Runtime) execAll(steps []*backend.Step) <-chan error {
// Executes the step and returns the state and error. // Executes the step and returns the state and error.
func (r *Runtime) exec(step *backend.Step) (*backend.State, error) { func (r *Runtime) exec(step *backend.Step) (*backend.State, error) {
// TODO: using DRONE_ will be deprecated with 0.15.0. remove fallback with following release
for key, value := range step.Environment {
if strings.HasPrefix(key, "CI_") {
step.Environment[strings.Replace(key, "CI_", "DRONE_", 1)] = value
}
}
if err := r.engine.Exec(r.ctx, step); err != nil { if err := r.engine.Exec(r.ctx, step); err != nil {
return nil, err return nil, err
} }