Repository: gobuffalo/buffalo

Issue #2028: buffalo build in directory without git repository reports error
Created: 2020-07-30T15:15:06Z
Description
buffalo build command generates error if the project directory is not under source control (.git directory absend), which is quite usual  for the docker builds. The error is fatal: not a git repository (or any of the parent directories): .git \exit status 128
Steps to Reproduce the Problem

Go to any project directory
Delete .git directory
run buffalo build

Expected Behavior
It should be documented that buffalo build attemts to do something with the version control. Plus, it is unclear if this error affects the build somehow.
Actual Behavior
Nothing is known about this behavior of the build command.
Info
Please run buffalo info and paste the information below where it says "PASTE_HERE".

-> Go: Checking installation
The `go` executable was found on your system at: D:\Go\bin\go.exe

-> Go: Checking minimum version requirements
Your version of Go, 1.14.6, meets the minimum requirements.

-> Go: Checking Package Management
You are using Go Modules (`go`) for package management.

-> Go: Checking PATH
Your PATH contains D:\Development\go/bin.

-> Node: Checking installation
The `node` executable was found on your system at: D:\nodejs\node.exe

-> Node: Checking minimum version requirements
Your version of Node, v12.16.1, meets the minimum requirements.

-> NPM: Checking installation
The `npm` executable was found on your system at: D:\nodejs\npm.cmd

-> NPM: Checking minimum version requirements
Your version of NPM, 6.13.4, meets the minimum requirements.

-> Yarn: Checking installation
The `yarnpkg` executable was found on your system at: C:\Program Files (x86)\Yarn\bin\yarnpkg.cmd

-> Yarn: Checking minimum version requirements
Your version of Yarn, 1.22.4, meets the minimum requirements.

-> PostgreSQL: Checking installation
The `postgres` executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:

https://www.postgresql.org/download/

-> MySQL: Checking installation
The `mysql` executable could not be found on your system.
For help setting up your MySQL environment please follow the instructions for you platform at:

https://www.mysql.com/downloads/

-> SQLite3: Checking installation
The `sqlite3` executable could not be found on your system.
For help setting up your SQLite3 environment please follow the instructions for you platform at:

https://www.sqlite.org/download.html

-> Cockroach: Checking installation
The `cockroach` executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:

https://www.cockroachlabs.com/docs/stable/

-> Buffalo (CLI): Checking installation
The `buffalo` executable was found on your system at: C:\ProgramData\chocolatey\bin\buffalo.exe

-> Buffalo (CLI): Checking minimum version requirements
Your version of Buffalo (CLI), v0.16.13, meets the minimum requirements.

-> Buffalo: Application Details
Pwd         \smarty
Root        \smarty
GoPath      D:\Development\go
PackagePkg  smarty
ActionsPkg  smarty/actions
ModelsPkg   smarty/models
GriftsPkg   smarty/grifts
WithModules true
Name        smarty
Bin         bin\smarty
VCS         git
WithPop     true
WithSQLite  false
WithDep     false
WithWebpack true
WithNodeJs  true
WithYarn    true
WithDocker  true
WithGrifts  true
AsWeb       true
AsAPI       false
InApp       true
PackageJSON {map[build:react-scripts build dev:react-scripts start eject:react-scripts eject start:react-scripts start test:react-scripts test]}

-> Buffalo: config/buffalo-app.toml
name = "smarty"
bin = "bin\\smarty"
vcs = "git"
with_pop = true
with_sqlite = false
with_dep = false
with_webpack = true
with_nodejs = true
with_yarn = true
with_docker = true
with_grifts = true
as_web = true
as_api = false

-> Buffalo: config/buffalo-plugins.toml
[[plugin]]
  binary = "buffalo-pop"
  go_get = "github.com/gobuffalo/buffalo-pop/v2"

-> Buffalo: config/config.go
package config

-> Buffalo: go.mod
module smarty

go 1.14

require (
        github.com/gobuffalo/buffalo v0.16.13
        github.com/gobuffalo/buffalo-pop/v2 v2.0.6
        github.com/gobuffalo/envy v1.9.0
        github.com/gobuffalo/flect v0.2.1
        github.com/gobuffalo/logger v1.0.3
        github.com/gobuffalo/mw-contenttype v0.0.0-20190129203934-2554e742333b
        github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
        github.com/gobuffalo/mw-i18n v0.0.0-20190129204410-552713a3ebb4
        github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525
        github.com/gobuffalo/packr/v2 v2.8.0
        github.com/gobuffalo/pop/v5 v5.2.3
        github.com/gobuffalo/suite/v3 v3.0.0
        github.com/gorilla/sessions v1.2.0
        github.com/markbates/grift v1.5.0
        github.com/pkg/errors v0.9.1
        github.com/rs/cors v1.7.0
        github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
)

Duplicate issue #2048: False error 'not a git repository' on docker build when app is in subdir or .git is in .dockerignore
Created: 2020-09-09T22:04:48Z
Description
RUN buffalo build --static -o /bin/app
fatal: not a git repository (or any of the parent directories): .git

but build succeeds.
Steps to Reproduce the Problem
Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the curl command you used, that sort of thing.

app in subdir  and use COPY ./app /app

Expected Behavior
no errors
Actual Behavior
fatal: not a git repository (or any of the parent directories): .git
Info
Please run buffalo info and paste the information below where it says "PASTE_HERE".
Buffalo version is: v0.16.14

Closing comment (2020-09-14T04:55:18Z): Related to: #2028
I fixed the issue locally by inserting:
RUN git init

Into my Dockerfile; will submit a PR.