Skip to content

sub-store-org/Sub-Store-Manager-Cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sub-Store-Manager-Cli

English | 简体中文

A CLI tool for managing Sub-Store backend service. Because of this tool based on docker, you should install docker first.

Install

You can install this tool by running the following command:

curl -sSL https://sub-store-org.github.io/resource/ssm/install.sh | bash

Or you can download release binary and configure your environment variable manually.

Usage

If you are using a script installation, you can directly execute the following commands. However, if you are doing a manual installation, please make sure to modify the program name in each command to match the executable file name.

new

Create a new sub-store docker container and run it. If the Image does not exist, it will be build automatically.

ssm new

this command support the following flags:

  • --interface or -i : When you use the -i flag, a sub-store front-end container is created instead of a backend container. The default behavior is to create a backend container.

  • --name or -n : A unique name for the container, default name is ssm-backend, If you create a frontend container with the -i flag, the default name will be ssm-frontend. This name will be used to manage persistent data. As long as the persistent data with this name is not manually deleted, or execute ssm delete with -c flag, it will be accessible whenever the container is rebuilt or when the image is deleted and then launched using this name.

  • --version or -v : A Sub-Store release version string, default is latest. If you pass -i to create a front-end container, -v will be ignored, it always uses the latest version of the front-end.

  • --port or -p : To successfully create a new Docker container, you need to specify the port mapping. The default port is 3000, and it must be available. If you pass -i to create a front-end container, the default port will be 80. If you want to access the container using a domain name, you will need to manually proxy this port with a reverse proxy tool such as Nginx or Caddy.

  • --network : Specify a docker network, which has the same effect as --network in docker run. If not specified, use Host mode. If specified, use Bridge mode. If the network exists, join it; if not, create it and then join.

  • --private : Switch the HostIP of the container to 127.0.0.1, if not specified, use the default 0.0.0.0.

update

To update a sub-store docker container, ensure that the image already exists and is running.

ssm update

this command support the following flags:

  • --name or -n : A name of running container, default name is ssm-backend.

  • --version or -v : A Sub-Store release version string, default is latest. If you update a front-end container, -v will be ignored, it always uses the latest version of the front-end.

start

Start a non-running sub-store Docker container by name, default name set as ssm-backend.

Equivalent to docker start <name>.

ssm new <name>

stop

Stop a running sub-store Docker container by name, default name set as ssm-backend.

Equivalent to docker stop <name>.

ssm stop <name>

delete

Delete a sub-store Docker container by name, default name set as ssm-backend.

Equivalent to docker rm -f <name>.

ssm delete <name>

this command support the following flags:

  • --clear or -c : Delete the persistent data of the container at the same time. If you delete a front-end container, -c will be ignored, because the front-end container does not have persistent data.

list

List all sub-store Docker containers.

Equivalent to docker ps -a, filter which container started by ssm image.

ssm ls

version

Print the version number of ssm.

ssm version

Uninstall

If you are using a script installation, you can directly execute the following command. If you are doing a manual installation, please manually remove your executable file.

rm -rf /usr/local/bin/ssm

If you want to delete the persistent data of the container at the same time, you can execute the following command:

rm -rf ~/.ssm

License

GPL-3.0 License