From 62926f488fd8eda8d66bee527403116fa8b77e28 Mon Sep 17 00:00:00 2001 From: Antonio Pagano <645522+paganotoni@users.noreply.github.com> Date: Thu, 22 Oct 2020 08:23:40 -0500 Subject: [PATCH] v0.16.16 (#2055) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com * Task updating formam (#2025) * v0.16.13 (#2019) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * updating formam Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * Fixes #1987 and #2023 (#2026) * v0.16.13 (#2019) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * fixing #1987 and #2023 * adding missing converstion * removing commented code Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * changing version number * moving to latest 2 go versions (#2038) * Task binding cleanup (#2039) * moving to latest 2 go versions * cleaning up the decoder on the binding package * Task update formam (#2041) * v0.16.14 (#2030) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com * Task updating formam (#2025) * v0.16.13 (#2019) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * updating formam Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * Fixes #1987 and #2023 (#2026) * v0.16.13 (#2019) * adding direct version on the docker build * fixing plugin installation * Fix npm's package.json permissions (#2005) Changed created file permissions from 644 (`-w----r--`) to 0644 (`rw-r--r--`) * Bump spf13/viper to v1.7.0 (#1999) * bunping version * changing version on dockerfile * patch to fix the keywords check on new app * removing unneeded append * Task fixing html binder (#2016) * binder was not wired * packing * adding new version number * pulling the buffalo binary from gobinaries.com Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * fixing #1987 and #2023 * adding missing converstion * removing commented code Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * changing version number Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * updates formam version #2040 Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> * updating flect versionm (#2042) * updating version * updating some libraries to pass the github security warnings (#2044) * Removing Grifts folder (#2050) * removing the grifts folder * removing grifts folder from codeclimate exceptions * fixes the non-existing .git folder case (#2053) * calling persist explicitly (#2054) * adding version number Co-authored-by: Disconnect3d Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com> --- .codeclimate.yml | 1 - Dockerfile.build | 2 +- Dockerfile.slim.build | 2 +- buffalo/cmd/build.go | 7 +++++++ grifts/tools.go | 37 ------------------------------------- route_info.go | 5 ++--- runtime/version.go | 2 +- 7 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 grifts/tools.go diff --git a/.codeclimate.yml b/.codeclimate.yml index a6456d0ee..f39e7cad7 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -18,7 +18,6 @@ exclude_paths: - "generators/*/templates/**/*" - "buffalo/cmd/filetests/*" - "examples/**/*" - - "grifts/**/*" - "vendor/**/*" - "**/*_test.go" - "*_test.go" diff --git a/Dockerfile.build b/Dockerfile.build index 16af7cd1a..0f83c15d6 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -32,7 +32,7 @@ RUN npm install -g --no-progress yarn \ # Install golangci RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 # Installing buffalo binary -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.15 | sh +RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.16 | sh RUN go get github.com/gobuffalo/buffalo-pop/v2 RUN buffalo version diff --git a/Dockerfile.slim.build b/Dockerfile.slim.build index 788b59d1a..4badb0dfe 100644 --- a/Dockerfile.slim.build +++ b/Dockerfile.slim.build @@ -17,7 +17,7 @@ RUN npm i -g --no-progress yarn \ && yarn config set yarn-offline-mirror-pruning true # Pulling docker binary from releases -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.15 | sh +RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.16 | sh RUN go get github.com/gobuffalo/buffalo-pop/v2 RUN buffalo version diff --git a/buffalo/cmd/build.go b/buffalo/cmd/build.go index 1c663668e..9f75d89f7 100644 --- a/buffalo/cmd/build.go +++ b/buffalo/cmd/build.go @@ -130,9 +130,16 @@ func buildVersion(version string) string { run.Logger.Warnf("could not find %s; defaulting to version %s", vcs, version) return vcs } + var cmd *exec.Cmd switch vcs { case "git": + // If .git folder does not exist return default version + if stat, err := os.Stat(".git"); err != nil || !stat.IsDir() { + run.Logger.Warnf("could not find .git folder; defaulting to version %s", version) + return version + } + cmd = exec.Command("git", "rev-parse", "--short", "HEAD") case "bzr": cmd = exec.Command("bzr", "revno") diff --git a/grifts/tools.go b/grifts/tools.go deleted file mode 100644 index e8d989bdc..000000000 --- a/grifts/tools.go +++ /dev/null @@ -1,37 +0,0 @@ -package grifts - -import ( - "os" - "os/exec" - - "github.com/markbates/grift/grift" -) - -var _ = grift.Namespace("tools", func() { - - var run = func(args ...string) error { - cmd := exec.Command(args[0], args[1:]...) - cmd.Stdin = os.Stdin - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - return cmd.Run() - } - - var _ = grift.Add("install", func(c *grift.Context) error { - if _, err := exec.LookPath("golangci-lint"); err != nil { - if err := run("go", "get", "-v", "github.com/golangci/golangci-lint/cmd/golangci-lint"); err != nil { - return err - } - } - return nil - }) - - var _ = grift.Add("lint", func(c *grift.Context) error { - if err := grift.Run("tools:install", c); err != nil { - return err - } - - return run("golangci-lint", "run", "--fast", "--deadline=3m") - }) - -}) diff --git a/route_info.go b/route_info.go index b0d7f8fec..3309abbed 100644 --- a/route_info.go +++ b/route_info.go @@ -94,8 +94,6 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { a := ri.App c := a.newContext(ri, res, req) - defer c.Flash().persist(c.Session()) - payload := events.Payload{ "route": ri, "app": a, @@ -103,8 +101,8 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { } events.EmitPayload(EvtRouteStarted, payload) - err := a.Middleware.handler(ri)(c) + c.Flash().persist(c.Session()) if err != nil { status := http.StatusInternalServerError @@ -117,5 +115,6 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { c.Response().WriteHeader(status) c.Response().Write([]byte(err.Error())) } + events.EmitPayload(EvtRouteFinished, payload) } diff --git a/runtime/version.go b/runtime/version.go index 52302ec37..9ec0a5fa2 100644 --- a/runtime/version.go +++ b/runtime/version.go @@ -1,4 +1,4 @@ package runtime // Version is the current version of the buffalo binary -var Version = "v0.16.15" +var Version = "v0.16.16"