I am trying to deploy a revel app in heroku, in which I have this folder structure:
+Base
+app
+controllers
-app.go
+views
+models
-user.go
+routes
+conf
+public
+test
.godir
In app.go I try to include models and routes doing this:
import("base/app/models")
I am able to run app in local, and after I can use models.User. I had tried to make a lot of ways to import these local packages in heroku:
import("../models")
import("../models/user")
import("./app/models")
import("./base/app/models")
I don't remember now all attempts, but I am trying it for a long time and I don't know ho to do.
I am using locally go 1.6, and 1.4 when I push. And this is the trace that appears when I run git push heroku master
Counting objects: 93, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (93/93), 11.68 KiB | 0 bytes/s, done.
Total 93 (delta 50), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Revel app detected
remote: -----> Using go1.4
remote: -----> Running: go get -tags heroku ./...
remote: can't load package: /tmp/build_02574263f0810eec437968b2e73f635d/.go/src/base/app/controllers/gorp.go:10:2: local import "../models" in non-local package
remote: ! Push rejected, failed to compile Revel app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to ndc-console.
remote:
To https://git.heroku.com/ndc-console.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ndc-console.git'
It happens using import("base/app/models").
Any solution?? Thank you.
EDIT
I log into heroku bash (running heroku run bash) and I see the folder structure, and it is something like:
bin
dev
more...
app /*This is the base folder*/
app
controllers
views
models
routes
config
public
.go /*this is the GOPATH*/
src
github.com
golang.org
gopkg.in
base-test /* This name is because I change the original name, from base-test to base... */
/* IS IT IMPORTANT? */
/* Inside this folder the app is duplicated */
In this way I tried too import("base-test/app/models") and too including all path from root (trying absurd things).
I hope it helps to find a solution. Thanks.
Ok!!! done!!
Finally, the old name of the project was generating a problem. It seems that when I change the name of the heroku app, heroku doesn't change the name of the folder when it will be compiled... AND I need change too the content of the .godir file and set it as base-test (the old name).
So now the imports I have looks like: import("base-test/app/models").
Thank you everyone.
Related
I'm trying to deploy a Go web app to Heroku using this template and this guide. Working great locally, but when I try to deploy with
git push heroku master
I get this error:
remote: Parsing meta tags from https://github.com?go-get=1 (status code 200)
remote: can't load package: package github.com/f4ww4z/sipss: unknown import path "github.com/f4ww4z/sipss": cannot find module providing package github.com/f4ww4z/sipss
remote: ! Push rejected, failed to compile Go app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to sipss.
remote:
To https://git.heroku.com/sipss.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sipss.git'
Full log after the deployment command is here.
I see that heroku's actually detected the module github.com/f4ww4z/sipss in the go.mod file (see log link), so why is it throwing this cannot find module providing package github.com/f4ww4z/sipss ?
Looks like your git repo is private. Read this https://github.com/heroku/heroku-buildpack-go#private-git-repos
I'm using Git to mount an app to Scalingo, but when I do "git push scalingo master" it shows me this:
XXXXX+AAAA#AAAA MINGW32 ~/Desktop/Scalingo (master)
$ git push scalingo master
Counting objects: 1120, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1043/1043), done.
Writing objects: 100% (1120/1120), 16.71 MiB | 1.53 MiB/s, done.
Total 1120 (delta 208), reused 0 (delta 0)
<-- Start deployment of vinumtest -->
Fetching source code
Fetching deployment cache
-----> Installing requirements with pip
You must give at least one requirement to install (see "pip help
install")
Build complete, shipping your container...
Waiting for your application to boot...
! Error deploying the application
! → Your application has stopped unexpectedly when starting
! Read the output and fix your code accordingly
! Common errors: http://doc.scalingo.com/deployment/start-
error#crashed
! Need help? Email us: support#scalingo.com
To git#scalingo.com:test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#scalingo.com:test.git'
The actual result is that I cant do the command "git push scalingo master"
As the message in the deployment is telling you:
You must give at least one requirement to install (see "pip help install")
It seems that your requirements.txt does not contain any dependency. All the Python modules you're using should be listed in this file.
What kind of application are you trying to deploy?
Whatever is the app, you have to ensure that your application is working on your local workstation before deploying it.
Regards,
-- Léo
well simply this is what i am getting;
sa#sa-VPCW11S1E:/opt/hubot/bin$ heroku buildpacks
=== young-everglades-12415 Buildpack URL
heroku/java
sa#sa-VPCW11S1E:/opt/hubot/bin$ sudo git push heroku master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 2.14 KiB | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon- buildpacks.s3.amazonaws.com/buildpacks/heroku/java.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to young-everglades-12415.
remote:
To https://git.heroku.com/young-everglades-12415.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/young- everglades-12415.git'
sa#sa-VPCW11S1E:/opt/hubot/bin$
although i did set a buildpack on the app git push failed because no buildpack detected ?
How can i resolve this, and is it actually the right steps towards deploying hubot ?
The heroku build packs still use the detection script to identify the language in use. Since Hubot is not a java project and it looks like you are using the java build pack, I suspect the detection script failed.
To fix this, try removing the buildpack.
% heroku buildpacks:remove heroku/java
After this I would try,
% git push heroku master
(Optional) I believe the rediscloud addon is needed for some scripts. You can add it with,
% heroku addons:create rediscloud
Then watch the logs heroku logs and see what happens.
There is a good deployment guide in hubot/deploying/heroku.md
I have one problem.
I have one app in play framework.
I'm using play 2.2. My code is github and when I send command "git push heroku master" I have this problem:
Initializing repository, done.
Counting objects: 574, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (512/512), done.
Writing objects: 100% (574/574), 1.45 MiB | 315 KiB/s, done.
Total 574 (delta 172), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
! Push rejected, no Cedar-supported app detected
To git#heroku.com:projetosplay.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:projetosplay.git'
I have aplication.conf in my github and I set my project to use play 2 in heroku:
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-scala.git
I think is stange is that which command I type always give me the same message (example):
heroku open
! No app specified.
! Run this command from an app folder or specify which app to use with --app APP.
Then I put: heroku open --app .git and is work.
Anybody has one idea ?
thanks !!!
Did you perhaps forget to create a procfile? You need such a file with e.g. following content:
web: play run --http.port=$PORT $PLAY_OPTS
Like the Title, it throw me a Git Error message:
2013-06-08 13:51:35.249 GitHub for Mac Login[1883:707] AskPass with
arguments: (
"/Applications/GitHub.app/Contents/MacOS/GitHub for Mac Login",
"root#192.168.1.107's password: " )
2013-06-08 13:51:35.285 GitHub for Mac Login[1883:707] Error reading
attributes for password: OSStatus 840183217
Counting objects: 3, done.
Writing objects: 33% (1/3)
Writing objects: 66% (2/3)
Writing objects: 100% (3/3)
Writing objects: 100% (3/3), 215 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To root#192.168.1.107:/var/www/html/repository/ ! [remote rejected]
master -> master (branch is currently checked out) error: failed to
push some refs to 'root#192.168.1.107:/var/www/html/repository/' (1)
I'm a beginner of use git to control the program version, and I find something like GitHub for Mac to use easily.
What I should be in the linux server configuration?
I find some useful from
http://rogerdudler.github.io/git-guide/
How to publish files to my server?
Thank you!
The error message says that you are trying to push to a non-bare repository, i.e. a normal repository rather than one that was created (with git init --bare) to enable it to function easily as a "central" repository that can be pushed to.
If you want more guidance on how to get started with git, take a look at the question
Git for beginners: The definitive practical guide