-
Notifications
You must be signed in to change notification settings - Fork 6
Heroku
If you haven't known yet, Heroku is a service that provide free/paid cloud platform.
Here we only talk about the free one.
Heroku allows us to run Java program on it as well. Although they only allow you to run it for 550 hours every month. But we don't care about the limit since Saliens only lasts 2 weeks anyway.
With Heroku, you can keep the program running 24/24 without having to keep your own PC on. Because Heroku will run it for us on their machines.
Your Heroku account may get banned by doing this.
I haven't got any report about account suspended from anybody using this program. But many other scripts with similar functions as us have their users' heroku account suspended.
I'm still using this on Heroku just fine. But still I can't ensure your Heroku account's safeness.
This guide is best for window user. Because I only know windows' commands.
You definitely can do the same on mac/linux as well. Just use the right commands for your OS.
And keep in mind that it's a bit tiresome to update SaliensAuto to Heroku.
Go to the site then register/login. Then create a new app on their website. You can leave the app's name blank and they'll generate a random name for you if you're lazy.
We'll use the name a lot so keep it in sight to not waste your precious time.
Download and install the Heroku CLI.
When you keep reading and doing as I said but there are some weird errors happen, try download and install Java 8 and Maven 3 as well. I have these installed already so I don't know if it's required or not.
Then open your command/shell, for example on windows we open cmd.exe. Then use this command:
heroku login
Then you just login with your email and password. Make sure you logged in successfully though. Then press Ctrl C if necessery to stop the thing.
Execute these commands:
cd C:\
git clone https://github.com/KickVN/SaliensAuto.git
cd SaliensAuto
heroku git:remote -a <app_name>
Replace <app_name> with the name of the app you created in step 1. Also, you can cd to wherever you want instead of C:\. Just remember where you set for later use.
Go to your C:\ disk, you will see a new folder called SaliensAuto. You will create a text file named Procfile here with the content:
worker: java -jar target/SaliensAuto.jar <token> 1 1
Replace with your token. Also make sure that the file name is just plainly Procfile, no dot, no txt, no extension. And so, Procfile's file path will be C:\SaliensAuto\Procfile
Execute these commands:
git add .
git commit -am "saliensauto"
git push heroku master
Then you wait for it to deploy. After that, use this command if necessary:
heroku ps:scale worker=1 -a <app_name>
Again, replace <app_name> with your app's name on Heroku.
And it should be done. Go to Heroku, choose your app -> More -> View logs and see if it worked. Something like https://dashboard.heroku.com/apps//logs
In case there is a new version of SaliensAuto come out and you want to update it to Heroku, you have to remove the folder SaliensAuto in C:\ and redo from Step 3 onward.