cactus / go-camo

A secure image proxy server
MIT License
255 stars 48 forks source link

Heroku deployment failure. #22

Closed johnbeynon closed 6 years ago

johnbeynon commented 6 years ago

Has anyone tried to deploy this to Heroku recently? I followed the steps in the Readme but it didn't deploy cleanly.

remote: -----> Installing go1.9.2
remote: -----> Fetching go1.9.2.linux-amd64.tar.gz... done
remote: -----> Fetching errors-0.8.0.tar.gz... done
remote: -----> Fetching gb-0.4.4.tar.gz... done
remote: -----> Installing GB v0.4.4... done
remote: -----> Running: gb build -tags heroku
remote: FATAL: command "build" failed: failed to resolve import path "go-camo": import "github.com/cactus/mlog": not found: stat /tmp/build_88ee5abdb34d81f2c8b95e589722bb0f/src/github.com/cactus/mlog: no such file or directory
remote:  !     Push rejected, failed to compile Go app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !    Push rejected to usercontent-go.
remote:

PS. I'm not a Go-pher but want to switch to using this over the Node version.

dropwhile commented 6 years ago

hmm. I admit to not using heroku -- support for heroku was kindly added by another user at one point quite a while ago.

Let's see if we can't get it working though.

It looks a bit like gb vendor restore isn't being run in the above steps, so dependencies aren't being fetched. You could try to "pre-fetch" the dependencies, commit them locally, then upload that to heroku.

$ cd go-camo

$ ls -1
CHANGELOG.md
DEPS.md
LICENSE.md
Makefile
Procfile
README.md
bin/
examples/
man/
pkg/
signify.pub
src/
tools/
vendor/

$ ls -1 vendor/
manifest

$ export GOPATH=/tmp/go-camo-test

$ make build-setup
Getting github.com/cactus/mlog
Getting github.com/stretchr/testify/assert
Getting github.com/davecgh/go-spew/spew
Getting github.com/jessevdk/go-flags
Getting github.com/pmezard/go-difflib/difflib

$ ls -1 vendor/
manifest
src/

$ git rm .gitignore
$ git commit -am "adding vendor/src to pre-seed deps for heroku"

# heroku steps. Not sure if this is correct here?
$ git push heroku master
dropwhile commented 6 years ago

Any update on this @johnbeynon?

dropwhile commented 6 years ago

Update - deps are not added to the repo itself, instead of pulled in as part of the build process. Seem to be the standard practice these days, and the list of deps is thankfully pretty small.

I finally got this done, to specifically help solve this issue. You should no longer need the steps I previously outlined.

Let me know if that is not the case. Closing as solved (master branch, anything more recent than 2f5ec75b0770cfdfd32f2c58abe69f4a7d62756d) . :crossed_fingers: