huginn / huginn

Create agents that monitor and act on your behalf. Your agents are standing by!
MIT License
43.12k stars 3.75k forks source link

Updating a "Deploy to Heroku" installation #521

Closed d4h0 closed 10 years ago

d4h0 commented 10 years ago

Hi,

How do I update Huginn if I have used the Heroku button to deploy it?

Can someone please add this information to https://github.com/cantino/huginn/wiki/Run-Huginn-for-free-on-Heroku ?

I've tried:

git remote add upstream https://github.com/cantino/huginn.git git fetch upstream git checkout master && git merge upstream/master

After that I was planning to run

git push heroku master

but the command before failed with the output at the end of this message.

Best regards, Daniel

daniel-mcbook:huginn42 dah$ git checkout master && git merge upstream/master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Auto-merging spec/spec_helper.rb
CONFLICT (add/add): Merge conflict in spec/spec_helper.rb
Auto-merging spec/models/agents/rss_agent_spec.rb
CONFLICT (add/add): Merge conflict in spec/models/agents/rss_agent_spec.rb
Auto-merging spec/models/agents/data_output_agent_spec.rb
CONFLICT (add/add): Merge conflict in spec/models/agents/data_output_agent_spec.rb
Auto-merging spec/models/agent_spec.rb
CONFLICT (add/add): Merge conflict in spec/models/agent_spec.rb
Auto-merging spec/helpers/dot_helper_spec.rb
CONFLICT (add/add): Merge conflict in spec/helpers/dot_helper_spec.rb
Auto-merging spec/fixtures/users.yml
CONFLICT (add/add): Merge conflict in spec/fixtures/users.yml
Auto-merging spec/env.test
CONFLICT (add/add): Merge conflict in spec/env.test
Auto-merging spec/controllers/web_requests_controller_spec.rb
CONFLICT (add/add): Merge conflict in spec/controllers/web_requests_controller_spec.rb
Auto-merging spec/controllers/agents_controller_spec.rb
CONFLICT (add/add): Merge conflict in spec/controllers/agents_controller_spec.rb
Auto-merging spec/concerns/liquid_interpolatable_spec.rb
CONFLICT (add/add): Merge conflict in spec/concerns/liquid_interpolatable_spec.rb
Auto-merging lib/huginn_scheduler.rb
CONFLICT (add/add): Merge conflict in lib/huginn_scheduler.rb
Auto-merging deployment/Cheffile.lock
CONFLICT (add/add): Merge conflict in deployment/Cheffile.lock
Auto-merging deployment/Cheffile
CONFLICT (add/add): Merge conflict in deployment/Cheffile
Auto-merging db/schema.rb
CONFLICT (add/add): Merge conflict in db/schema.rb
Auto-merging config/routes.rb
CONFLICT (add/add): Merge conflict in config/routes.rb
Auto-merging config/initializers/delayed_job.rb
CONFLICT (add/add): Merge conflict in config/initializers/delayed_job.rb
Auto-merging config.ru
CONFLICT (add/add): Merge conflict in config.ru
Auto-merging bin/threaded.rb
CONFLICT (add/add): Merge conflict in bin/threaded.rb
Auto-merging bin/spring
CONFLICT (add/add): Merge conflict in bin/spring
Auto-merging app/views/user_credentials/index.html.erb
CONFLICT (add/add): Merge conflict in app/views/user_credentials/index.html.erb
Auto-merging app/views/services/index.html.erb
CONFLICT (add/add): Merge conflict in app/views/services/index.html.erb
Auto-merging app/views/scenarios/index.html.erb
CONFLICT (add/add): Merge conflict in app/views/scenarios/index.html.erb
Auto-merging app/views/layouts/application.html.erb
CONFLICT (add/add): Merge conflict in app/views/layouts/application.html.erb
Auto-merging app/views/layouts/_navigation.html.erb
CONFLICT (add/add): Merge conflict in app/views/layouts/_navigation.html.erb
Auto-merging app/views/events/show.html.erb
CONFLICT (add/add): Merge conflict in app/views/events/show.html.erb
Auto-merging app/views/agents/show.html.erb
CONFLICT (add/add): Merge conflict in app/views/agents/show.html.erb
Auto-merging app/views/agents/agent_views/user_location_agent/_show.html.erb
CONFLICT (add/add): Merge conflict in app/views/agents/agent_views/user_location_agent/_show.html.erb
Auto-merging app/views/agents/_table.html.erb
CONFLICT (add/add): Merge conflict in app/views/agents/_table.html.erb
Auto-merging app/views/agents/_form.html.erb
CONFLICT (add/add): Merge conflict in app/views/agents/_form.html.erb
Auto-merging app/views/agents/_action_menu.html.erb
CONFLICT (add/add): Merge conflict in app/views/agents/_action_menu.html.erb
Auto-merging app/models/event.rb
CONFLICT (add/add): Merge conflict in app/models/event.rb
Auto-merging app/models/agents/user_location_agent.rb
CONFLICT (add/add): Merge conflict in app/models/agents/user_location_agent.rb
Auto-merging app/models/agents/rss_agent.rb
CONFLICT (add/add): Merge conflict in app/models/agents/rss_agent.rb
Auto-merging app/models/agents/data_output_agent.rb
CONFLICT (add/add): Merge conflict in app/models/agents/data_output_agent.rb
Auto-merging app/models/agent.rb
CONFLICT (add/add): Merge conflict in app/models/agent.rb
Auto-merging app/helpers/dot_helper.rb
CONFLICT (add/add): Merge conflict in app/helpers/dot_helper.rb
Auto-merging app/helpers/agent_helper.rb
CONFLICT (add/add): Merge conflict in app/helpers/agent_helper.rb
Auto-merging app/controllers/web_requests_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/web_requests_controller.rb
Auto-merging app/controllers/user_credentials_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/user_credentials_controller.rb
Auto-merging app/controllers/services_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/services_controller.rb
Auto-merging app/controllers/scenarios_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/scenarios_controller.rb
Auto-merging app/controllers/application_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/application_controller.rb
Auto-merging app/controllers/agents_controller.rb
CONFLICT (add/add): Merge conflict in app/controllers/agents_controller.rb
Auto-merging app/concerns/twitter_concern.rb
CONFLICT (add/add): Merge conflict in app/concerns/twitter_concern.rb
Auto-merging app/concerns/liquid_interpolatable.rb
CONFLICT (add/add): Merge conflict in app/concerns/liquid_interpolatable.rb
Auto-merging app/concerns/liquid_droppable.rb
CONFLICT (add/add): Merge conflict in app/concerns/liquid_droppable.rb
Auto-merging app/assets/stylesheets/application.css.scss.erb
CONFLICT (add/add): Merge conflict in app/assets/stylesheets/application.css.scss.erb
Auto-merging app/assets/javascripts/worker-checker.js.coffee
CONFLICT (add/add): Merge conflict in app/assets/javascripts/worker-checker.js.coffee
Auto-merging app/assets/javascripts/application.js.coffee.erb
CONFLICT (add/add): Merge conflict in app/assets/javascripts/application.js.coffee.erb
Auto-merging README.md
CONFLICT (add/add): Merge conflict in README.md
Auto-merging Gemfile.lock
CONFLICT (add/add): Merge conflict in Gemfile.lock
Auto-merging Gemfile
CONFLICT (add/add): Merge conflict in Gemfile
Auto-merging CHANGES.md
CONFLICT (add/add): Merge conflict in CHANGES.md
Auto-merging .travis.yml
CONFLICT (add/add): Merge conflict in .travis.yml
Auto-merging .env.example
CONFLICT (add/add): Merge conflict in .env.example
Automatic merge failed; fix conflicts and then commit the result.
cantino commented 10 years ago

I'm surprised that didn't work, as your steps make sense.

What do you get when you run git status? I'd try git reset --hard, git fetch upstream, and git merge upstream/master.

d4h0 commented 10 years ago

git status said there are many files that are newly added or changed. Your suggestion didn't work.

I've deleted and re-installed the app and now updating seems to work.

I don't have much experience with Git and I've probably done something wrong.

Anyway, thanks for your help!

Another related question that I have is do I have to re-run bundle before "git push heroku master" when I update Huginn?

sloanelybutsurely commented 10 years ago

Hey @bolus, while you don't have to re-run bundle before you git push heroku master doing so won't hurt anything. Any new/updated dependencies will get installed locally and if nothing has changed in the Gemfile it will execute rather quickly. However, it would be a good idea to run bundle again should you rerun bin/setup_heroku.

Now this is just because I'm curious: Are you by chance running Windows locally? I feel like it is possible that some configuration or program you've used may have changed the line endings in some files and that might have caused those merge conflicts. Just a hunch.

signallhill commented 10 years ago

Try the solution below, it worked for me using windows.

https://github.com/cantino/huginn/commit/85fb86b1cb459d723e8462f9c1cf50036440d787

d4h0 commented 10 years ago

Thanks @zperrault. No, I don't use Windows. I'm using Mac OS X

@signallhill, thanks but reinstalling Huginn fixed the problem already.

cantino commented 10 years ago

So, oddly, I got this too and fixed it with git remote add public https://github.com/cantino/huginn.git && git fetch public && git merge public/master -X theirs, but this will lose any code changes you've made in your fork and so should only be used right after a fresh launch of the Heroku button. Does anyone know why this is happening with Heroku? It's like git has no idea about the history.

cantino commented 10 years ago

/cc @knu @dsander

knu commented 10 years ago

Looks like the repository created for the app by Heroku consists of one commit which imports a snapshot of the original master on GitHub, so it does not have a fast-forward relationship with the original repository.

We could probably make setup_heroku run git remote add origin https://github.com/cantino/huginn.git && git reset --hard origin/master && git push --force --set-upstream heroku master in the very first run.

Checking if there is no commit made by user could be confirmed with [ $(git log --oneline | wc -l) -eq 1 ].

cantino commented 10 years ago

@knu, I think that's a good idea. This is a confusing experience right now. Would you mind trying that? If you don't have time, I'll give it a go.

knu commented 10 years ago

@cantino Please review the PR above!