Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
v0.16.6 (#1974)
Browse files Browse the repository at this point in the history
* merge changes from buffalo-cli into main repo

* cache deps before building and copying source (#1884)

cache deps before building and copying source so that we don't need to re-download as much
and so that source changes don't invalidate our downloaded layer

* Generator resource action test breaks with unused imports fixes #1893 (#1894)

* Generator resource action test breaks with unused imports fixes #1893

* break packr cache

* fix broken test

* update deps (#1896)

* update deps

* update envy

* update meta

* switch to tags/v3 for consistency (#1901)

* update helpers/tags

* update validate

* try to fix mismatched imports (#1921)

* fixes more broken semantic import paths (#1925)

* adding a few packages to replace

* Replace Azure badge with Github actions badge (#1920)

Co-authored-by: Antonio Pagano <[email protected]>

* changing the packages to be replaced (#1928)

* changing the packages to be replaced

* adding back gobuffalo/uuid change

* Merging master (#1936)

* v0.16.1 (#1929)

* merge changes from buffalo-cli into main repo

* cache deps before building and copying source (#1884)

cache deps before building and copying source so that we don't need to re-download as much
and so that source changes don't invalidate our downloaded layer

* Generator resource action test breaks with unused imports fixes #1893 (#1894)

* Generator resource action test breaks with unused imports fixes #1893

* break packr cache

* fix broken test

* update deps (#1896)

* update deps

* update envy

* update meta

* switch to tags/v3 for consistency (#1901)

* update helpers/tags

* update validate

* try to fix mismatched imports (#1921)

* fixes more broken semantic import paths (#1925)

* adding a few packages to replace

* Replace Azure badge with Github actions badge (#1920)

Co-authored-by: Antonio Pagano <[email protected]>

* changing the packages to be replaced (#1928)

* changing the packages to be replaced

* adding back gobuffalo/uuid change

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>

* Add stack trace to ErrPanic event for easier debugging and monitoring (#1930)

Co-authored-by: Canh Nguyen <[email protected]>

* Modifies our docker file to pull buffalo binary from releases. (#1935)

* fixing docker image to use github binary

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>
Co-authored-by: xuancanh <[email protected]>
Co-authored-by: Canh Nguyen <[email protected]>

* Update js template to support font awesome (#1933)

* v0.16.1 (#1929)

* merge changes from buffalo-cli into main repo

* cache deps before building and copying source (#1884)

cache deps before building and copying source so that we don't need to re-download as much
and so that source changes don't invalidate our downloaded layer

* Generator resource action test breaks with unused imports fixes #1893 (#1894)

* Generator resource action test breaks with unused imports fixes #1893

* break packr cache

* fix broken test

* update deps (#1896)

* update deps

* update envy

* update meta

* switch to tags/v3 for consistency (#1901)

* update helpers/tags

* update validate

* try to fix mismatched imports (#1921)

* fixes more broken semantic import paths (#1925)

* adding a few packages to replace

* Replace Azure badge with Github actions badge (#1920)

Co-authored-by: Antonio Pagano <[email protected]>

* changing the packages to be replaced (#1928)

* changing the packages to be replaced

* adding back gobuffalo/uuid change

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>

* Add stack trace to ErrPanic event for easier debugging and monitoring (#1930)

Co-authored-by: Canh Nguyen <[email protected]>

* Update js template to support font awesome

The latest version of font-awesome requires the js file to also be present for a glyph to work.  To see this work, add this code to any page template:

```html
<h3>
<a href=#" target="_blank"><i class="fab fa-twitter-square share" aria-hidden="true"></i></a>
</h3>
```

Without this JS file, the glyph will not render.

Co-authored-by: Antonio Pagano <[email protected]>
Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>
Co-authored-by: xuancanh <[email protected]>
Co-authored-by: Canh Nguyen <[email protected]>

* Fixes generated package.json and resources generator (#1944)

* v0.16.1 (#1929)

* merge changes from buffalo-cli into main repo

* cache deps before building and copying source (#1884)

cache deps before building and copying source so that we don't need to re-download as much
and so that source changes don't invalidate our downloaded layer

* Generator resource action test breaks with unused imports fixes #1893 (#1894)

* Generator resource action test breaks with unused imports fixes #1893

* break packr cache

* fix broken test

* update deps (#1896)

* update deps

* update envy

* update meta

* switch to tags/v3 for consistency (#1901)

* update helpers/tags

* update validate

* try to fix mismatched imports (#1921)

* fixes more broken semantic import paths (#1925)

* adding a few packages to replace

* Replace Azure badge with Github actions badge (#1920)

Co-authored-by: Antonio Pagano <[email protected]>

* changing the packages to be replaced (#1928)

* changing the packages to be replaced

* adding back gobuffalo/uuid change

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>

* Add stack trace to ErrPanic event for easier debugging and monitoring (#1930)

Co-authored-by: Canh Nguyen <[email protected]>

* Modifies our docker file to pull buffalo binary from releases. (#1935)

* fixing docker image to use github binary

* Bump pop version (#1937)

* adding resource and new app generator fixes

* fixing buffalo generator to use v5 of pop

* updating popper and removing repeated version of webpack-manifest

* updating old tooling on the JS side

* updating webpack version

* updating node dependencies on fixture to remove github warnings

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>
Co-authored-by: xuancanh <[email protected]>
Co-authored-by: Canh Nguyen <[email protected]>

* updating dockerfile to use v0.16.3

* packing

* Adding new template for codeclimate code analysis (#1946)

* adding new template for codeclimate code analysis

* packing

* Updates our coke app package.json and Yarn (#1947)

* updating package.lock on the lock sample

* removing old pop plugin

* adding task to the fixers

* removing the fixer part

* Removes old buffalo-pop plugin (#1948)

* removes old buffalo-pop plugin

* naming change

* using filepath for auto render files (#1951)

* Bugfix c.Error http code (#1952)

* fixes error code not being logged

* adding tests for the status code when error handled fires

* Allows to set test timeout (#1953)

* allowing to pass timeout to the test command

* packing

* Fixes plush to use now plush/v4 (#1954)

* Adding packr files (#1956)

* Missing comments on the Plugins struct (#1958)

* Adding packr files

* adding a couple of comments missing

* fixing mispell package (#1960)

* Task #1941 (#1943)

* covering non id cases on the route name generator

* fixing broken tests

* adding a few more test cases

* moving to just use a string for simplified ID

* bumping version

* packing

* use go 1.14 for building goreleaser binaries (#1962)

* adds an extra file to our releases that will be pulled by our docker images build process (#1964)

* cleaning some docker issues (#1966)

* Fix GO111MODULE value in build Docker images (#1970)

* Add in GZIP compression to file serving (#1969)

* Add in GZIP compression to file serving

* Add option to control gzip

* Added genny support for CircleCI as a CI provider. (#1972)

* Added genny support for CircleCI as a CI provider.

* Updated circleci template

* Also fixed Travis and GitLab templates

* removing helpers from the Go template Engine (#1971)

* adding next version

* packing

* making codeclimate ignore packr files

Co-authored-by: Mark Bates <[email protected]>
Co-authored-by: Dr Nic Williams <[email protected]>
Co-authored-by: HD Moore <[email protected]>
Co-authored-by: Stanislas Michalak <[email protected]>
Co-authored-by: xuancanh <[email protected]>
Co-authored-by: Canh Nguyen <[email protected]>
Co-authored-by: Cory LaNou <[email protected]>
Co-authored-by: Vlad Artamonov <[email protected]>
Co-authored-by: Vincent Chu <[email protected]>
Co-authored-by: James Turnbull <[email protected]>
  • Loading branch information
11 people authored Apr 21, 2020
1 parent fcaae36 commit 296baa6
Show file tree
Hide file tree
Showing 22 changed files with 128 additions and 36 deletions.
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ exclude_paths:
- "*_test.go"
- "**_test.go"
- "middleware_test.go"
- packrd/**.go
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
-
name: Set up Go 1.13
name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.14
id: go
-
name: Checkout Code
Expand Down
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ builds:
goarm:
- 6
- 7
hooks:
post: tar -czvf dist/buffalo_Linux_x86_64.tar.gz dist/buffalo_linux_amd64
archives:
-
replacements:
Expand All @@ -35,6 +37,9 @@ changelog:
exclude:
- '^docs:'
- '^test:'
release:
extra_files:
- glob: ./dist/buffalo_Linux_x86_64.tar.gz
brews:
-
name: 'buffalo'
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:latest
EXPOSE 3000

ENV GOPROXY=https://proxy.golang.org
ENV GO111MODULE=ON
ENV GO111MODULE=on

RUN go version

Expand Down Expand Up @@ -33,10 +33,12 @@ RUN npm install -g --no-progress yarn \
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0

# Pulling docker binary from releases
RUN wget https://github.com/gobuffalo/buffalo/releases/download/v0.16.3/buffalo_0.16.3_Linux_x86_64.tar.gz \
&& tar -xzf buffalo_0.16.3_Linux_x86_64.tar.gz \
RUN wget https://github.com/gobuffalo/buffalo/releases/latest/download/buffalo_Linux_x86_64.tar.gz \
&& tar -xzf buffalo_Linux_x86_64.tar.gz \
&& mv buffalo $(go env GOPATH)/bin/buffalo

RUN buffalo plugins install github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

WORKDIR $GOPATH/src
RUN mkdir /src
WORKDIR /src
11 changes: 6 additions & 5 deletions Dockerfile.slim.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ FROM golang:alpine
EXPOSE 3000

ENV GOPROXY=https://proxy.golang.org
ENV GO111MODULE=ON
ENV GO111MODULE=on

ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo
ENV GOPROXY=https://proxy.golang.org

RUN apk add --no-cache --upgrade apk-tools \
Expand All @@ -20,10 +19,12 @@ RUN npm i -g --no-progress yarn \
&& yarn config set yarn-offline-mirror-pruning true

# Pulling docker binary from releases
RUN wget https://github.com/gobuffalo/buffalo/releases/download/v0.16.3/buffalo_0.16.3_Linux_x86_64.tar.gz \
&& tar -xzf buffalo_0.16.3_Linux_x86_64.tar.gz \
RUN wget https://github.com/gobuffalo/buffalo/releases/latest/download/buffalo_Linux_x86_64.tar.gz \
&& tar -xzf buffalo_Linux_x86_64.tar.gz \
&& mv buffalo $(go env GOPATH)/bin/buffalo

RUN buffalo plugins install github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

WORKDIR $GOPATH/src
RUN mkdir /src
WORKDIR /src
2 changes: 1 addition & 1 deletion buffalo/cmd/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func init() {
newCmd.Flags().Bool("skip-yarn", false, "use npm instead of yarn for frontend dependencies management")
newCmd.Flags().String("db-type", "postgres", fmt.Sprintf("specify the type of database you want to use [%s]", strings.Join(pop.AvailableDialects, ", ")))
newCmd.Flags().String("docker", "multi", "specify the type of Docker file to generate [none, multi, standard]")
newCmd.Flags().String("ci-provider", "none", "specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci]")
newCmd.Flags().String("ci-provider", "none", "specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci, circleci]")
newCmd.Flags().String("vcs", "git", "specify the Version control system you would like to use [none, git, bzr]")
newCmd.Flags().String("module", "", "specify the root module (package) name. [defaults to 'automatic']")
viper.BindPFlags(newCmd.Flags())
Expand Down
4 changes: 3 additions & 1 deletion genny/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/gobuffalo/packr/v2"
)

// New generator for adding travis or gitlab
// New generator for adding travis, gitlab, or circleci
func New(opts *Options) (*genny.Generator, error) {
g := genny.New()

Expand All @@ -32,6 +32,8 @@ func New(opts *Options) (*genny.Generator, error) {
} else {
fname = "-dot-gitlab-ci-no-pop.yml.tmpl"
}
case "circleci":
fname = "-dot-circleci/config.yml.tmpl"
default:
return g, fmt.Errorf("could not find a template for %s", opts.Provider)
}
Expand Down
27 changes: 27 additions & 0 deletions genny/ci/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,30 @@ func Test_New_Gitlab_No_pop(t *testing.T) {
r.Equal(".gitlab-ci.yml", f.Name())
r.NotContains(f.String(), "postgres:5432")
}

func Test_New_Circle(t *testing.T) {
r := require.New(t)

g, err := New(&Options{
Provider: "circleci",
DBType: "postgres",
})
r.NoError(err)

run := gentest.NewRunner()
run.With(g)

r.NoError(run.Run())

res := run.Results()

r.Len(res.Commands, 0)
r.Len(res.Files, 1)

f := res.Files[0]
r.Equal(".circleci/config.yml", f.Name())
circleYml := struct {
Version int
}{}
r.NoError(yaml.NewDecoder(f).Decode(&circleYml), "config.yml is a valid YAML file")
}
2 changes: 1 addition & 1 deletion genny/ci/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Available CI implementations
var Available = []string{"travis", "gitlab"}
var Available = []string{"travis", "gitlab", "circleci"}

// Options for CI
type Options struct {
Expand Down
45 changes: 45 additions & 0 deletions genny/ci/templates/-dot-circleci/config.yml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.12
{{ if eq .opts.DBType "postgres" -}}
- image: circleci/postgres:9.6-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: {{.opts.App.Name.File}}_test
{{- end }}

environment:
TEST_RESULTS: /tmp/test-results

steps:
- checkout
- run: mkdir -p $TEST_RESULTS

- restore_cache:
keys:
- v1-pkg-cache

- run: go get github.com/jstemmer/go-junit-report

- run: go get github.com/gobuffalo/buffalo/buffalo
- run: go mod download

- run:
name: Run unit tests
command: |
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
buffalo test | tee ${TEST_RESULTS}/go-test.out

- save_cache:
key: v1-pkg-cache
paths:
- "/go/pkg"

- store_artifacts:
path: /tmp/test-results
destination: raw-test-output

- store_test_results:
path: /tmp/test-results
2 changes: 1 addition & 1 deletion genny/ci/templates/-dot-gitlab-ci-no-pop.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ before_script:
- cd /go/src/{{.opts.App.PackagePkg}}
- mkdir -p public/assets
- go get -u github.com/gobuffalo/buffalo/buffalo
- go get -t -v ./...
- go mod download
- export PATH="$PATH:$GOPATH/bin"

stages:
Expand Down
2 changes: 1 addition & 1 deletion genny/ci/templates/-dot-gitlab-ci.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ before_script:
- cd /go/src/{{.opts.App.PackagePkg}}
- mkdir -p public/assets
- go get -u github.com/gobuffalo/buffalo/buffalo
- go get -t -v ./...
- go mod download
- export PATH="$PATH:$GOPATH/bin"

stages:
Expand Down
2 changes: 1 addition & 1 deletion genny/ci/templates/-dot-travis.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ go_import_path: {{.opts.App.PackagePkg}}

install:
- go get github.com/gobuffalo/buffalo/buffalo
- go get $(go list ./... | grep -v /vendor/)
- go mod download

script: buffalo test
4 changes: 2 additions & 2 deletions genny/docker/templates/multi/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FROM gobuffalo/buffalo:{{.opts.Version}} as builder
ENV GO111MODULE on
ENV GOPROXY http://proxy.golang.org

RUN mkdir -p $GOPATH/src/{{.opts.App.PackagePkg}}
WORKDIR $GOPATH/src/{{.opts.App.PackagePkg}}
RUN mkdir -p /src/{{.opts.App.PackagePkg}}
WORKDIR /src/{{.opts.App.PackagePkg}}

{{if .opts.App.WithWebpack -}}
# this will cache the npm install step, unless package.json changes
Expand Down
4 changes: 2 additions & 2 deletions genny/docker/templates/standard/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM gobuffalo/buffalo:{{.opts.Version}}
ENV GO111MODULE on
ENV GOPROXY http://proxy.golang.org

RUN mkdir -p $GOPATH/src/{{.opts.App.PackagePkg}}
WORKDIR $GOPATH/src/{{.opts.App.PackagePkg}}
RUN mkdir -p /src/{{.opts.App.PackagePkg}}
WORKDIR /src/{{.opts.App.PackagePkg}}

{{if .opts.App.AsWeb -}}
{{if .opts.App.WithWebpack -}}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ require (
github.com/gobuffalo/pop/v5 v5.0.11
github.com/gobuffalo/tags/v3 v3.1.0
github.com/google/go-cmp v0.4.0
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.4
github.com/gorilla/sessions v1.2.0
github.com/karrick/godirwalk v1.15.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE0
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
Expand Down
5 changes: 5 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ type Options struct {
// a Buffalo application.
PreWares []PreWare `json:"-"`

// CompressFiles enables gzip compression of static files served by ServeFiles using
// gorilla's CompressHandler (https://godoc.org/github.com/gorilla/handlers#CompressHandler).
// Default is "false".
CompressFiles bool `json:"compress_files"`

Prefix string `json:"prefix"`
Context context.Context `json:"-"`

Expand Down
Loading

0 comments on commit 296baa6

Please sign in to comment.