Skip to content

Latest commit

 

History

History
132 lines (82 loc) · 3.94 KB

2.USAGE_EN.md

File metadata and controls

132 lines (82 loc) · 3.94 KB

Usage Document

1. Introduction

Sparrow is a Docker tool for one-click startup of multiple services and environments.

2. Dependencies

This project relies entirely on Docker, so Docker must be installed and running.

3. Installation and Update

This project offers two different installation methods: development version and release version. The differences between the two are as follows. Please choose according to your needs:

  • Development version: The project updates at a high frequency, so the features and functionalities are always up-to-date! However, there may be some bugs that cannot be avoided, and 100% stability cannot be guaranteed.
  • Release version: A version of the project released at a certain point in time, which has undergone multi-level testing and has been running stably for a period of time. You can view various release versions here.

(1) Development Version

① Installation

If it's the first time, you can use the following commands to install.

# get project
git clone https://github.com/WGrape/sparrow.git
cd sparrow

# install
bash _install.sh

# usage help
./sparrow --help

② Update

After installation, if you need to update to the latest development version, execute the following command to begin the update.

bash _update.sh

(2) Release Version

① Installation

If you need a specific version of the release package, please click here to download, and then follow these steps.

cd sparrow

# install
bash _install.sh

# usage help
./sparrow --help

② Update

Please note that the release package does not support updates! So after installing a specific version of the release package, please do not execute the bash _update.sh command.

4. Quick Start

(1) Start

Use the following command to start all services in the entire environment. Of course, this all services can be defined and is controlled by the ENABLE_SERVICE_LIST array variable configured in the /.env file in the root directory.

./sparrow start

① Start a Specific Service

If you only need to start a specific service, you can use the following command. The service passed in is the name of a service in the services list in the docker-compose.yml configuration file, such as phpfpm/nginx/mysql/redis, etc.

./sparrow startone {service_name}

② Test if Startup is Successful

Use the following command, if nothing wrong output, it means the installation is successful.

bash .work/test/run.sh

(2) Stop

Stop all services in the entire environment

./sparrow stop

(3) Restart

Restart all services in the entire environment

./sparrow restart

(4) Update

When the content of the image needs to be modified to support new requirements, the services need to be updated, which is actually updating the image.

① Update a Service

./sparrow updateone {service}

② Usage Example

When we need to adjust the Go version to 1.17.0 (default is 1.21.1), follow these steps:

  1. First, modify the official image: change IMAGE_OFFICIAL_GO_VERSION=1.21.1 in the /.env file to IMAGE_OFFICIAL_GO_VERSION=1.17.0.
  2. Then, modify the basic image: change IMAGE_BASIC_GO_VERSION=1.21.1 in the /.env file to IMAGE_BASIC_GO_VERSION=1.17.0.
  3. Finally, update the go service: execute ./sparrow updateone go.

More examples and explain,please check How to update a service doc.

(5) Monitor

If you need to view the running status of sparrow and the container information of the allowed services, you can use the following command.

./sparrow status