This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit e874eefe05fc9d28960711db5da32fe575decb3b
Author: Yaolong Liu <[email protected]>
AuthorDate: Fri Jun 10 11:09:37 2022 +0800

    RATIS-1589. Get ratis-shell resource from bin tarball (#656)
    
    (cherry picked from commit aa777961a4c9eab5537bf0dfdc7ba81f06307233)
---
 ratis-assembly/src/main/assembly/bin.xml | 24 ++++++++++++++++++++++++
 ratis-docs/content/cli.md                | 25 +++++++++++++++++++++++--
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/ratis-assembly/src/main/assembly/bin.xml 
b/ratis-assembly/src/main/assembly/bin.xml
index 04642647..0648efdb 100644
--- a/ratis-assembly/src/main/assembly/bin.xml
+++ b/ratis-assembly/src/main/assembly/bin.xml
@@ -83,5 +83,29 @@
       <fileMode>0644</fileMode>
       <directoryMode>0755</directoryMode>
     </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../ratis-shell/target/</directory>
+      <outputDirectory>ratis-shell/lib/shell</outputDirectory>
+      <fileMode>755</fileMode>
+      <includes>
+        <include>ratis-shell-*-jar-with-dependencies.jar</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../ratis-shell/src/main/bin</directory>
+      <outputDirectory>ratis-shell/bin</outputDirectory>
+      <fileMode>755</fileMode>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../ratis-shell/src/main/libexec</directory>
+      <outputDirectory>ratis-shell/libexec</outputDirectory>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+    <fileSet>
+      <directory>${project.basedir}/../ratis-shell/src/main/conf</directory>
+      <outputDirectory>ratis-shell/conf</outputDirectory>
+      <fileMode>644</fileMode>
+    </fileSet>
   </fileSets>
 </assembly>
diff --git a/ratis-docs/content/cli.md b/ratis-docs/content/cli.md
index ab2d4850..25ebd355 100644
--- a/ratis-docs/content/cli.md
+++ b/ratis-docs/content/cli.md
@@ -23,8 +23,16 @@ Ratis-shell is the command line interface of Ratis.
 > Ratis-shell is currently only **experimental**.
 > The compatibility story is not considered for the time being.
 
+## Availability
+| Version  | Available in src tarball? | Available in bin tarball? |
+| :------: | :-----------------------: | :-----------------------: |
+| < 2.3.0  | No                        | No                        |
+| 2.3.0    | Yes                       | No                        |
+| \> 2.3.0 | Yes                       | Yes                       |
+
 ## Setting up the ratis-shell
 
+### Setting up from a source tarball
 Download the Ratis source tarball from https://ratis.apache.org/downloads.html 
.
 Note that ratis-shell is available starting from version 2.3.0.
 Extract the source tarball to a destination directory `<DST_DIR>`
@@ -41,12 +49,25 @@ $ mvn -DskipTests -Prelease -Papache-release clean package 
assembly:single
 
 Extract the ratis-shell tarball.
 ```
-$ tar -C <DST_DIR>/ratis-shell -xzf 
ratis-assembly/target/apache-ratis-<VERSION>-shell.tar.gz
+$ mkdir <DST_DIR>/ratis-shell
+$ tar -C <DST_DIR>/ratis-shell -xzf 
ratis-assembly/target/apache-ratis-<VERSION>-shell.tar.gz --strip-component 1
+```
+
+### Setting up from a binary tarball
+Download the Ratis bin tarball from https://ratis.apache.org/downloads.html .
+Note that the bin tarball of Ratis version 2.3.0 or earlier does not contain 
ratis-shell.
+The bin tarball of later versions will contain ratis-shell.
+Extract the bin tarball to a destination directory `<DST_DIR>`
+```
+$ tar -C <DST_DIR> -zxvf apache-ratis-<VERSION>-bin.tar.gz 
apache-ratis-<VERSION>/ratis-shell
+$ cd <DST_DIR>
+$ mv apache-ratis-<VERSION>/ratis-shell .
+$ rmdir apache-ratis-<VERSION>/
 ```
 
 Export the `RATIS_SHELL_HOME` environment variable and add the bin directory 
to the `$PATH`.
 ```
-$ export RATIS_SHELL_HOME=<DST_DIR>/ratis-shell/apache-ratis-<VERSION>
+$ export RATIS_SHELL_HOME=<DST_DIR>/ratis-shell
 $ export PATH=${RATIS_SHELL_HOME}/bin:$PATH
 ```
 

Reply via email to