Skip to content

Commit

Permalink
Starter ruby app (#999)
Browse files Browse the repository at this point in the history
* rename this file

* refactor ruby tutorial to be a starter app.
  • Loading branch information
johrstrom authored Sep 18, 2024
1 parent e411d92 commit bac82b7
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 484 deletions.
2 changes: 1 addition & 1 deletion source/release-notes/v1.8-release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Added Sinatra Ruby Gems into ondemand-gems for other apps to use
................................................................

Related Ruby gems for the micro-webframework "Sinatra" were added to the Dashboard Gemfile to ensure they are included in the ``ondemand-gems`` RPM.
Simple applications like the Passenger status app featured in the :ref:`Passenger app development tutorial <app-development-tutorials-passenger-apps-ps-to-quota>` can now be run without needing to install gem dependencies into the application directory. The following gems were added for this purpose:
Simple applications like the Passenger status app featured in the :ref:`Ruby Starter application <app-development-tutorials-passenger-apps-starter-ruby-app>` can now be run without needing to install gem dependencies into the application directory. The following gems were added for this purpose:

.. code-block:: ruby
Expand Down
2 changes: 1 addition & 1 deletion source/tutorials/tutorials-passenger-apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ At the bottom of the page is a list of tutorials for developing Passenger apps f
:maxdepth: 2
:caption: Tutorials

tutorials-passenger-apps/ps-to-quota
tutorials-passenger-apps/ruby-starter-app
tutorials-passenger-apps/nodejs-starter-app
tutorials-passenger-apps/python-starter-app
52 changes: 52 additions & 0 deletions source/tutorials/tutorials-passenger-apps/deploy-to-production.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Publish App
-----------

Publishing an app requires two steps:

#. Updating the ``manifest.yml`` to specify the category and optionally subcategory, which indicates where in the dashboard menu the app appears.

#. Having an administrator checkout a copy of the production version to a directory under ``/var/www/ood/apps/sys``.


Steps:

#. Add category to manifest so the app appears in the Files menu:

.. code-block:: diff

name: Quota
description: Display quotas
icon: fa://hdd-o
+category: Files
+subcategory: Utilities

#. Version these changes. Click **Shell** button on app details view, and then ``commit`` the changes:

.. code-block:: sh

git add .
git commit -m "update manifest for production"

# if there is an external remote associated with this, push to that
git push origin master

#. As the admin, ``sudo copy`` or ``git clone`` this repo to production

.. code-block:: sh

# as sudo on OnDemand host:
cd /var/www/ood/apps/sys
git clone /users/PZS0562/efranz/ondemand/dev/quota


#. **Reload** the dashboard.

.. figure:: /images/app-dev-tutorial-ps-to-quota-published.png
:align: center

Every user can now launch the Quota from the Files menu.

.. warning::

Accessing this new app for the first time will cause your NGINX server to restart,
killing all websocket connections, which means resetting your active web-based OnDemand Shell sessions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ There you should see this application at the top of the list. Clicking
When the new tab opens you should see a blank page with the text ``Hello World``.
This is your new `NodeJs`_ application!

.. include:: deploy-to-production.inc

.. _NodeJs: https://nodejs.org/en
.. _Express: https://expressjs.com/
Loading

0 comments on commit bac82b7

Please sign in to comment.