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

Better build instructions, please #782

Closed
Nuru opened this issue Sep 20, 2019 · 1 comment
Closed

Better build instructions, please #782

Nuru opened this issue Sep 20, 2019 · 1 comment
Labels
docs Documentation

Comments

@Nuru
Copy link
Contributor

Nuru commented Sep 20, 2019

I was trying to make a pretty simple PR, just change a tiny bit of HTML and CSS, but building Atlantis proved challenging. I am new to go and its build requirements, but even accounting for that I think it was harder than it needed to be.

First of all, despite the comprehensive documentation on how to run and test Atlantis locally, I could find nothing about how to build it locally. So I tried using make, but ran into lots of problems (output edited for brevity, go 1.12.7 installed):

$ make build-service
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -v -o atlantis .
build flag -mod=vendor only valid when using modules
make: *** [build-service] Error 1

$ make dist
/bin/sh: go-bindata-assetfs: command not found
make: *** [dist] Error 127

$ go get github.com/elazarl/go-bindata-assetfs/...
$ make dist
/bin/sh: go-bindata-assetfs: command not found
make: *** [dist] Error 127

$ export PATH=$GOPATH/bin:$PATH
$ make dist
rm -f server/static/bindata_assetfs.go && go-bindata-assetfs -pkg static -prefix server server/static/... && mv bindata_assetfs.go server/static
mv: rename bindata_assetfs.go to server/static/bindata_assetfs.go: No such file or directory
make: *** [dist] Error 1

$ make release
...
Packaging...
find: ./output: No such file or directory

$ mkdir output
$ make release
...
./scripts/binary-release.sh
-> running clean up....
-> building...
Error reading packages: exit status 1
Stderr: go: downloading github.com/google/go-github/v28 v28.0.0
...

Packaging...


-----------------------------------
Output:
total 0
drwxr-xr-x   2 user  admin    68B Sep 20 02:12 .
drwxr-xr-x  31 user  admin   1.0K Sep 20 02:12 ..

$ make build-service
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -v -o atlantis .
build github.com/runatlantis/atlantis: cannot load github.com/runatlantis/atlantis/server/static: no Go source files

$ mv bindata.go server/static/bindata_assetfs.go
$ make build-service
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -v -o atlantis .
build flag -mod=vendor only valid when using modules
make: *** [build-service] Error 1

$ make release
./scripts/binary-release.sh
-> running clean up....
-> building...
Number of parallel builds: 7

-->       linux/386: github.com/runatlantis/atlantis
-->     linux/amd64: github.com/runatlantis/atlantis
-->    darwin/amd64: github.com/runatlantis/atlantis
-->       linux/arm: github.com/runatlantis/atlantis

Packaging...
--> darwin_amd64
  adding: atlantis (deflated 59%)
--> linux_386
  adding: atlantis (deflated 55%)
--> linux_amd64
  adding: atlantis (deflated 59%)
--> linux_arm
  adding: atlantis (deflated 56%)


-----------------------------------
Output:
total 106752
drwxr-xr-x  10 user  admin   340B Sep 20 02:40 .
drwxr-xr-x  31 user  admin   1.0K Sep 20 02:32 ..
-rw-r--r--   1 user  admin    13M Sep 20 02:40 atlantis_darwin_amd64.zip
-rw-r--r--   1 user  admin    13M Sep 20 02:40 atlantis_linux_386.zip
-rw-r--r--   1 user  admin    13M Sep 20 02:40 atlantis_linux_amd64.zip
-rw-r--r--   1 user  admin    12M Sep 20 02:40 atlantis_linux_arm.zip
drwxr-xr-x   3 user  admin   102B Sep 20 02:40 darwin_amd64
drwxr-xr-x   3 user  admin   102B Sep 20 02:40 linux_386
drwxr-xr-x   3 user  admin   102B Sep 20 02:40 linux_amd64
drwxr-xr-x   3 user  admin   102B Sep 20 02:40 linux_arm

So at the very least, the build of bindata_assetfs.go needs to be fixed.

Ideally, the release target would depend on the needed artifacts and automatically build them. Also the build-service target should work to build a local version for dev/test.

@lkysow lkysow added the docs Documentation label Sep 23, 2019
@jamengual
Copy link
Contributor

Closed due to inactivity, if this still needed comment and we will reopen but check the latest docs/features first.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation
Projects
None yet
Development

No branches or pull requests

3 participants