Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install heroku cli on linux *without* root, and *no auto update*

I am a CS professor trying to teach web app development (Flask, Rails, SparkJava, etc.) using Heroku.

Our computing environment is a centrally managed Linux system, where neither the students nor I, have root permission. The students also have a very limited file and disk quotas: 200MB of space, and 4000 individual files.

I used to be able to provide them a way to give them access to the Heroku toolbelt by hacking the "standalone install" to get around the default assumption that the person doing the install has root permission.

But it is no longer working. When I install into a directory and run from there, the Heroku toolbelt keeps trying to "auto-update" into the ~/.local/share for each individual user and since the Heroku-CLI installation has over 12000 files in it (!) it blows their file quota.

This is madness. I want to have just ONE installation of the Heroku toolbelt client, update it centrally and NOT have each student have to have their own copy. Is this too much to ask? Is there any way to do this?

There used to be some trick to making the client think it was already up-to-date or some way to configure it to NOT do the auto-update. But I can't find how to do it.

(Thanks in advance for all of your good ideas such as: have them work on their own laptops, make a VM, have them work on AWS, etc. Those are all great ideas for some parallel universe in which they are feasible. If I could use any other computing environment, I'd already been doing that. This is the one I have. If I can't make Heroku work here, I just can't use Heroku in class. And it's frustrating because it used to work.)

like image 448
Phill Conrad Avatar asked Aug 17 '16 18:08

Phill Conrad


People also ask

Why heroku CLI is not working?

If you're having issues with the CLI, ensure that you're using the latest version. If you're not, try updating with heroku update . Not all methods of installation support heroku update . If you installed the CLI with apt , you must use sudo apt-get update && sudo apt-get upgrade heroku .

How do you know if heroku CLI is installed?

Open Command Prompt by right-clicking the Start Menu, choose Run, enter cmd and click OK. Now type heroku and press enter. If you receive a help message, heroku-cli was installed successfully.

How do I deploy a heroku terminal?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.


1 Answers

As a quick and dirty solution you can in lib/heroku/updater.rb change

def self.needs_update?   compare_versions(latest_version, latest_local_version) > 0 end 

to

def self.needs_update?   false end 

and you will not be bugged with updates anymore. You have to do this each time you want to update manually.

A better more maintainable solution would be to get a config value or something similar for controlling this behavior accepted upstream in the toolbelt, which is open source at https://github.com/heroku/heroku

like image 97
Daniel Landau Avatar answered Oct 10 '22 16:10

Daniel Landau