Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Heroku
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Installation== * [[EDTLaptop1#Heroku|Windows 10 Laptop]] ==Concepts== * all Heroku applications run in a collection of lightweight Linux containers called '''Dynos'''. To find out the dynos: heroku ps * Procfiles can contain additional process types. For example, you can declare a background worker that processes items off a queue. * The set of dynos declared in your Procfile and managed by the dyno manager via heroku ps:scale are known as the '''dyno formation'''. These dynos do the app’s regular business (such as handling web requests and processing background jobs) as it runs. When you wish to do one-off administrative or maintenance tasks for the app, or execute some task periodically using Heroku Scheduler, you can spin up a '''one-off dyno'''. ===Interface=== * [https://id.heroku.com/login Dashboard] login with user, password and Salesforce App on mobile ===Config and Environment Variables=== * config variables are static and available via <code>heroku config</code> or via the Heroku Dashboard * environment variables are dynamic and are available via <code>heroku run env</code> ==Add Ons== ===Databases=== * [https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java documentation] * connection information see config var DATABASE_URL [database type]://[username]:[password]@[host]:[port]/[database name] ====Postgres==== * DB info [https://dashboard.heroku.com/apps dashboard] -> <APPLICATION> -> Resources ==Operation== ===List all Applications=== heroku apps ===Delete Application=== heroku apps:destroy uweheuer-capstone ===Show Infos for Apps like Repo Size=== heroku apps:info ===List all Domains (for Applications)=== heroku domains ===Logging=== * via dasboard [[File:heroku1.PNG|400px]] * or via command line heroku logs --tail ==Example== ===Official Tutorial=== * from [https://devcenter.heroku.com/articles/getting-started-with-python official python tutorial] PS C:\Temp\python-getting-started> heroku login * clone example * create app and push code * start the app PS C:\Temp\python-getting-started> heroku ps:scale web=1 Scaling dynos... done, now running web at 1:Free PS C:\Temp\python-getting-started> heroku open // opens https://arcane-peak-78109.herokuapp.com/ * open the [https://dashboard.heroku.com/apps dashboard] * stop it or scale it down to 0 heroku ps:scale web=0 * prepare for running locally PS C:\Temp\python-getting-started> python -m venv venv PS C:\Temp\python-getting-started> .\venv\Scripts\activate (venv) PS C:\Temp\python-getting-started> pip install -r .\requirements.txt * run it locally (venv) PS C:\Temp\python-getting-started> python manage.py collectstatic (venv) PS C:\Temp\python-getting-started> heroku local -f .\Procfile.windows * open it http://localhost:5000/ ===Spring Boot Demo=== ====Configuration for Heroku==== * steps from [https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku offical Spring Boot tutorial] * create demo1 application in <code>C:\Uwes\Programme\eclipse\workspace\demo1</code> and git it * see SpringBoot.docx * When deploying an app, Heroku reads <code>pom.xml</code> file and installs the dependencies by running <code>mvn clean install</code>. * check DB connection by C:\Uwes\Programme\PostgreSQL\12\bin> .\[[Postgres#Operation|psql]] -h ec2-3-230-122-20.compute-1.amazonaws.com -U cepxizounlueue defpfuas3qslld * set specific configurations for Heroku by adding profile <code>heroku</code> to <code>pom.xml</code> and set config var <code>MAVEN_CUSTOM_OPTS</code> to <code>-P !local_dev,heroku</code> ====Run on Heroku==== git push heroku master heroku open // opens the application https://intense-caverns-96515.herokuapp.com/ in a browser ====Prepare Locally Heroku==== * create Procfile <code>Procfile.windows</code> for running locally with command to start the Spring application <code>java -jar target/demo1-0.0.1-SNAPSHOT.jar</code> * compile and build a JAR, with dependencies, placing it into your application’s target directory. The <code>spring-boot-maven-plugin</code> in the <code>pom.xml</code> provides this process mvn install * create local DB C:\Uwes\Programme\xampp7.2.27\mysql\bin\mysql --user=root --password=mHalloo0@1m create database demo1; * create <code>C:\Uwes\eclipse\workspace_2020-12\SpringBoot\demo1\set_local_dev.bat</code> * add profile local_dev to <code>pom.xml</code> ====Run Heroku Locally==== * run the application set_local_dev.bat // start eclipse by start_eclipse.bat from shell and run it or heroku local -f Procfile.windows ====Run Eclipse Locally==== * see <code>src\main\resources\application.properties</code> which is not in Git repository * start eclipse ==Resources== * [https://devcenter.heroku.com/articles/getting-started-with-python Tutorial] * [https://dashboard.heroku.com/apps Heroku dashboard]
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width