Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move envsubset into repo #394

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"runtime"
"strings"

"github.com/drone/envsubst"
"github.com/woodpecker-ci/woodpecker/pipeline"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/backend/docker"
Expand All @@ -22,6 +21,7 @@ import (
"github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/matrix"
"github.com/woodpecker-ci/woodpecker/pipeline/interrupt"
"github.com/woodpecker-ci/woodpecker/pipeline/multipart"
"github.com/woodpecker-ci/woodpecker/shared/envsubst"

"github.com/urfave/cli"
)
Expand Down
28 changes: 28 additions & 0 deletions cmd/envsubst/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package main

import (
"bufio"
"fmt"
"log"
"os"

"github.com/woodpecker-ci/woodpecker/shared/envsubst"
)

func main() {
stdin := bufio.NewScanner(os.Stdin)
stdout := bufio.NewWriter(os.Stdout)

for stdin.Scan() {
line, err := envsubst.EvalEnv(stdin.Text())
if err != nil {
log.Fatalf("Error while envsubst: %v", err)
}
_, err = fmt.Fprintln(stdout, line)
if err != nil {
log.Fatalf("Error while writing to stdout: %v", err)
}
stdout.Flush()
}
}

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/docker/docker-credential-helpers v0.6.3 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/libcompose v0.4.0
github.com/drone/envsubst v1.0.3
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/franela/goblin v0.0.0-20200512143142-b260c999b2d7
github.com/ghodss/yaml v1.0.0
Expand All @@ -26,6 +25,7 @@ require (
github.com/gogits/go-gogs-client v0.0.0-20160212212711-d584b1e0fb4d
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6
github.com/google/go-github/v39 v39.1.0
github.com/gorilla/securecookie v1.1.1
github.com/hashicorp/go-version v1.3.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ github.com/docker/libcompose v0.4.0/go.mod h1:EyqDS+Iyca0hS44T7qIMTeO1EOYWWWNOGp
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g=
github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
Expand Down
2 changes: 1 addition & 1 deletion server/shared/procBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"sort"
"strings"

"github.com/drone/envsubst"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
"github.com/woodpecker-ci/woodpecker/pipeline/frontend"
"github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml"
Expand All @@ -32,6 +31,7 @@ import (
"github.com/woodpecker-ci/woodpecker/server"
"github.com/woodpecker-ci/woodpecker/server/model"
"github.com/woodpecker-ci/woodpecker/server/remote"
"github.com/woodpecker-ci/woodpecker/shared/envsubst"
)

// ProcBuilder Takes the hook data and the yaml and returns in internal data model
Expand Down
8 changes: 0 additions & 8 deletions vendor/github.com/drone/envsubst/.drone.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/drone/envsubst/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/drone/envsubst/LICENSE

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/drone/envsubst/eval.go

This file was deleted.

246 changes: 0 additions & 246 deletions vendor/github.com/drone/envsubst/funcs.go

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/drone/envsubst/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/drone/envsubst/go.sum

This file was deleted.

Loading