This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into typescript
- Loading branch information
Showing
16 changed files
with
210 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,50 @@ | ||
FROM golang:latest | ||
|
||
RUN go version | ||
RUN go get -v -u github.com/markbates/deplist/deplist | ||
|
||
RUN apt-get update | ||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash | ||
RUN apt-get install -y build-essential nodejs | ||
RUN apt-get install -y sqlite3 libsqlite3-dev | ||
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | ||
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - | ||
RUN apt-get install -y postgresql postgresql-contrib libpq-dev | ||
RUN apt-get install -y -q mysql-client | ||
RUN apt-get install -y vim | ||
|
||
RUN go get -u github.com/golang/dep/cmd/dep | ||
RUN go get -v -u github.com/gobuffalo/makr | ||
RUN go get -v -u github.com/gobuffalo/packr | ||
RUN go get -v -u github.com/gobuffalo/tags | ||
RUN go get -v -u github.com/gobuffalo/pop | ||
RUN go get -v -u github.com/gobuffalo/x/... | ||
RUN go get -v -u github.com/mattn/go-sqlite3 | ||
RUN go get -v -u github.com/markbates/filetest | ||
RUN go get -v -u github.com/markbates/grift | ||
RUN go get -v -u github.com/markbates/inflect | ||
RUN go get -v -u github.com/markbates/refresh | ||
RUN go get -v -u github.com/markbates/willie | ||
RUN go get -v -u github.com/gorilla/sessions | ||
RUN go get -v -u golang.org/x/vgo | ||
RUN go get -u github.com/alecthomas/gometalinter | ||
RUN gometalinter --install | ||
|
||
RUN npm install -g --no-progress yarn | ||
RUN yarn config set yarn-offline-mirror /npm-packages-offline-cache | ||
RUN yarn config set yarn-offline-mirror-pruning true | ||
|
||
EXPOSE 3000 | ||
ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo | ||
|
||
RUN rm -rfv $BP | ||
RUN mkdir -p $BP | ||
RUN go version && go get -v -u github.com/markbates/deplist/deplist | ||
|
||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash \ | ||
&& sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' \ | ||
&& wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - \ | ||
&& apt-get update \ | ||
&& apt-get install -y -q build-essential nodejs sqlite3 libsqlite3-dev postgresql postgresql-contrib libpq-dev mysql-client vim \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN go get -u github.com/golang/dep/cmd/dep \ | ||
&& go get -v -u github.com/gobuffalo/makr \ | ||
&& go get -v -u github.com/gobuffalo/packr \ | ||
&& go get -v -u github.com/gobuffalo/tags \ | ||
&& go get -v -u github.com/gobuffalo/pop \ | ||
&& go get -v -u github.com/gobuffalo/x/... \ | ||
&& go get -v -u github.com/mattn/go-sqlite3 \ | ||
&& go get -v -u github.com/markbates/filetest \ | ||
&& go get -v -u github.com/markbates/grift \ | ||
&& go get -v -u github.com/markbates/inflect \ | ||
&& go get -v -u github.com/markbates/refresh \ | ||
&& go get -v -u github.com/markbates/willie \ | ||
&& go get -v -u github.com/gorilla/sessions \ | ||
&& go get -v -u golang.org/x/vgo \ | ||
&& go get -u github.com/alecthomas/gometalinter \ | ||
&& gometalinter --install | ||
|
||
RUN npm install -g --no-progress yarn \ | ||
&& yarn config set yarn-offline-mirror /npm-packages-offline-cache \ | ||
&& yarn config set yarn-offline-mirror-pruning true | ||
|
||
|
||
RUN rm -rfv $BP && mkdir -p $BP | ||
WORKDIR $BP | ||
|
||
ADD . . | ||
RUN go get -tags "sqlite" -v -t github.com/gobuffalo/buffalo/... | ||
RUN make install | ||
|
||
RUN go get -tags "sqlite" -v -t github.com/gobuffalo/buffalo/... && make install | ||
|
||
# cache yarn packages to an offline mirror so they're faster to load. hopefully. | ||
RUN grep -v '{{' ./generators/assets/webpack/templates/package.json.tmpl > package.json | ||
RUN yarn install --no-progress | ||
RUN grep -v '{{' ./generators/assets/webpack/templates/package.json.tmpl > package.json \ | ||
&& yarn install --no-progress | ||
|
||
RUN buffalo version | ||
|
||
WORKDIR $GOPATH/src | ||
|
||
RUN ls -la /npm-packages-offline-cache | ||
|
||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM golang:alpine | ||
EXPOSE 3000 | ||
ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo | ||
RUN apk add --no-cache --upgrade apk-tools \ | ||
&& apk add --no-cache bash curl openssl git build-base yarn nodejs postgresql libpq postgresql-contrib sqlite sqlite-dev mysql-client vim | ||
|
||
RUN go version && go get -v -u github.com/markbates/deplist/deplist | ||
|
||
|
||
RUN go get -u github.com/golang/dep/cmd/dep \ | ||
&& go get -v -u github.com/gobuffalo/makr \ | ||
&& go get -v -u github.com/gobuffalo/packr \ | ||
&& go get -v -u github.com/gobuffalo/tags \ | ||
&& go get -v -u github.com/gobuffalo/pop \ | ||
&& go get -v -u github.com/gobuffalo/x/... \ | ||
&& go get -v -u github.com/mattn/go-sqlite3 \ | ||
&& go get -v -u github.com/markbates/filetest \ | ||
&& go get -v -u github.com/markbates/grift \ | ||
&& go get -v -u github.com/markbates/inflect \ | ||
&& go get -v -u github.com/markbates/refresh \ | ||
&& go get -v -u github.com/markbates/willie \ | ||
&& go get -v -u github.com/gorilla/sessions \ | ||
&& go get -v -u golang.org/x/vgo \ | ||
&& go get -u github.com/alecthomas/gometalinter \ | ||
&& gometalinter --install | ||
|
||
RUN npm install -g --no-progress yarn \ | ||
&& yarn config set yarn-offline-mirror /npm-packages-offline-cache \ | ||
&& yarn config set yarn-offline-mirror-pruning true | ||
|
||
|
||
RUN rm -rfv $BP && mkdir -p $BP | ||
WORKDIR $BP | ||
|
||
ADD . . | ||
RUN go get -tags "sqlite" -v -t github.com/gobuffalo/buffalo/... && make install | ||
|
||
# cache yarn packages to an offline mirror so they're faster to load. hopefully. | ||
RUN grep -v '{{' ./generators/assets/webpack/templates/package.json.tmpl > package.json \ | ||
&& yarn install --no-progress | ||
|
||
RUN buffalo version | ||
|
||
WORKDIR $GOPATH/src | ||
|
||
RUN ls -la /npm-packages-offline-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_Bootstrap4_Default(t *testing.T) { | ||
r := require.New(t) | ||
f, err := newCmd.Flags().GetInt("bootstrap") | ||
r.NoError(err) | ||
r.Equal(4, f) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package plugins | ||
|
||
import ( | ||
"context" | ||
"io/ioutil" | ||
"strings" | ||
"testing" | ||
"time" | ||
|
||
"github.com/gobuffalo/envy" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestAskBin_respectsTimeout(t *testing.T) { | ||
r := require.New(t) | ||
|
||
from, err := envy.MustGet("BUFFALO_PLUGIN_PATH") | ||
if err != nil { | ||
t.Skipf("BUFFALO_PLUGIN_PATH not set.") | ||
return | ||
} | ||
|
||
if fileEntries, err := ioutil.ReadDir(from); err == nil { | ||
found := false | ||
for _, e := range fileEntries { | ||
if strings.HasPrefix(e.Name(), "buffalo-") { | ||
from = e.Name() | ||
found = true | ||
break | ||
} | ||
} | ||
if !found { | ||
t.Skipf("no plugins found") | ||
return | ||
} | ||
} else { | ||
r.Error(err, "plugin path not able to be read") | ||
return | ||
} | ||
|
||
const tooShort = time.Millisecond | ||
impossible, cancel := context.WithTimeout(context.Background(), tooShort) | ||
defer cancel() | ||
|
||
done := make(chan struct{}) | ||
go func() { | ||
askBin(impossible, from) | ||
close(done) | ||
}() | ||
|
||
select { | ||
case <-time.After(tooShort + 80*time.Millisecond): | ||
r.Fail("did not time-out quickly enough") | ||
case <-done: | ||
t.Log("timed-out successfully") | ||
} | ||
} |
Oops, something went wrong.