Yegor Sozonov
Yegor Sozonov

Reputation: 83

Can I download source code which has deployed with github from Heroku?

I have deployed my django-app on heroku with Github. It is test server so I am using sqlitedb. But because of the dyno manager, my sqlitedb resets everyday. So I am going to download only db on heroku.

I tried this command.

heroku git:clone -a APP-NAME

But this clones empty repository.

And when I run $heroku run bash -a APP-NAME command, I got ETIMEOUT error.

Is there any other way to download the source code on heroku?

Upvotes: 1

Views: 427

Answers (2)

Yegor Sozonov
Yegor Sozonov

Reputation: 83

I have solved with downloading the application slug.

If you have not used git to deploy your application, or using heroku git:clone has only created an empty repository, you can download the slug that was build when you application was last deployed.

First, install the heroku-slugs CLI plugin with heroku plugins:install heroku-slugs,

then run:

heroku slugs:download -a APP_NAME

This will download and compress your slug into a directory with the same name as your application.

Upvotes: 0

Tin Nguyen
Tin Nguyen

Reputation: 5330

What you want to do with git is not possible because changes to the database is not versioned.

The command to run bash on Heroku is heroku run bash, not heroku bash run. You may have to specify the app using the -a flag: https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-run

Upvotes: 2

Related Questions