Skip to content

Commit

Permalink
📝 Update the user signup tutorial with instructions on how to use the…
Browse files Browse the repository at this point in the history
… rh.sh script
  • Loading branch information
ujibang committed Dec 13, 2023
1 parent 2879302 commit 64d893c
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions docs/plugins/tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ NOTE: Source code available https://github.com/SoftInstigate/restheart/tree/mast

== Deployment Steps

1. Clone the restheart repo and navigate to the `user-signup` directory.
2. Build the plugin. This step uses the `maven-dependency-plugin` to copy the jar of the external dependency to `/target/lib`.
3. Copy the plugin JARs (`user-signup/target/user-signup.jar` and `user-signup/target/lib/*`) to the `$RH_HOME/plugins` directory.
First clone the restheart repository and cd into the `user-signup` directory.

[source,bash]
----
Expand All @@ -32,6 +30,48 @@ $ ../mvnw clean package
$ cp target/user-signup.jar target/lib/* $RH_HOME/plugins
----

=== Simplified Deployment with the `rh.sh` Script

NOTE: This method works if you are on a system able to execute bash scripts.

Ease your deployment process with the `rh.sh` script, a convenient tool for automating various tasks in setting up RESTHeart. You can retrieve this script from the link:https://github.com/SoftInstigate/restheart-plugin-skeleton[RESTHeart Plugin Skeleton repository].

**Downloading the Script**

Begin by creating a `bin` directory and downloading the `rh.sh` script into it:

[source,bash]
----
$ mkdir bin && curl https://raw.githubusercontent.com/SoftInstigate/restheart-plugin-skeleton/master/bin/rh.sh --output bin/rh.sh
----

Then link the Maven wrapper `mvnw` that is available on the parent directory because `rh.sh` requires it.

[source,bash]
----
$ ln -s ../mvnw mvnw
----

**Utilizing `rh.sh` for Effortless Deployment**

The `rh.sh` script is ingeniously designed to streamline the entire deployment process. It's capable of installing RESTHeart, building your code, deploying it, and initiating the RESTHeart server - all through a single command:

[source,bash]
----
$ ./bin/rh.sh -o "-o conf.yml"
----

**Important Configuration Step**: Before executing this script, ensure you have customized the `conf.yml` file with your SMTP server details. This configuration is crucial for the script to facilitate the sending of verification emails.

For detailed instructions on configuring your SMTP server in `conf.yml`, refer to the upcoming section titled **Configuration**.

=== Alternate method

1. Download and install RESTHeart. Check the link:/docs/setup[Setup] section.
2. Clone the restheart repo and navigate to the `user-signup` directory.
3. Build the plugin. This step uses the `maven-dependency-plugin` to copy the jar of the external dependency to `/target/lib`.
4. Copy the plugin JARs (`user-signup/target/user-signup.jar` and `user-signup/target/lib/*`) to the `$RH_HOME/plugins` directory.

== Configuration

Configure the `emailVerificationSender` interceptor with your SMTP server details for sending verification emails. Add the following in `conf.yml`:
Expand Down

0 comments on commit 64d893c

Please sign in to comment.