@ -18,6 +18,7 @@
- [4. Stopping Services by Process Names ](#4-stopping-services-by-process-names )
- [4. Stopping Services by Process Names ](#4-stopping-services-by-process-names )
- [Function: `openim::util::stop_services_with_name` ](#function-openimutilstop_services_with_name )
- [Function: `openim::util::stop_services_with_name` ](#function-openimutilstop_services_with_name )
- [Example: ](#example-3 )
- [Example: ](#example-3 )
- [system management and installation of openim via Linux system ](#system-management-and-installation-of-openim-via-linux-system )
- [examples ](#examples )
- [examples ](#examples )
@ -25,64 +26,92 @@ This document outlines the directory structure for scripts in the OpenIM Server
```bash
```bash
scripts/
scripts/
├── LICENSE # License related files
├── README.md # Documentation for the scripts directory.
│ ├── LICENSE # The license file
├── advertise.sh # Script to advertise or broadcast services.
│ └── LICENSE_TEMPLATES # Template for license file
├── batch_start_all.sh # Batch script to start all services.
├── README.md # Readme file for scripts directory
├── build-all-service.sh # Script to build all services.
├── advertise.sh # Script for advertisement services
├── build.cmd # Command script for building (usually for Windows).
├── batch_start-all.sh # Script to start all services in batch
├── check-all.sh # Check script for all components or services.
├── build.cmd # Windows build command script
├── cherry-pick.sh # Helper script for git cherry-pick operations.
├── build-all-service.sh # Script to build all services
├── common.sh # Common utilities and shared functions.
├── build_push_k8s_images.sh # Script to build and push images for Kubernetes
├── coverage.awk # AWK script for processing code coverage data.
├── check-all.sh # Script to check status of all services
├── coverage.sh # Script to gather and report code coverage.
├── common.sh # Contains common functions used by other scripts
├── demo.sh # Demonstration or example script.
├── coverage.awk # AWK script for coverage report generation
├── docker-check-service.sh # Docker script to check services' status.
├── coverage.sh # Script for generating coverage reports
├── docker-start-all.sh # Docker script to start all containers/services.
├── docker-check-service.sh # Docker specific service check script
├── ensure_tag.sh # Ensure correct tags or labeling.
├── docker-start-all-all.sh # Script to start all services in a docker environment
├── env_check.sh # Environment verification and checking.
├── ensure_tag.sh # Script to ensure proper tagging of docker images
├── gen-swagger-docs.sh # Script to generate Swagger documentation.
├── enterprise # Scripts specific to enterprise version
├── genconfig.sh # Generate configuration files.
│ ├── check-all.sh # Check status of all enterprise services
├── gendoc.sh # General documentation generation script.
│ ├── function.sh # Functions specific to enterprise version
├── githooks # Directory containing git hooks.
│ └── path_info.cfg # Path information configuration for enterprise version
│ ├── commit-msg # Git hook for commit messages.
├── env_check.sh # Script to check the environment
│ ├── pre-commit # Pre-commit git hook.
├── function.sh # Contains functions used by other scripts
│ └── pre-push # Pre-push git hook.
├── githooks # Git hook scripts
├── golangci.yml # Configuration for GolangCI linting.
│ ├── commit-msg # Script to validate commit message
├── init-config.sh # Initialize configurations.
│ ├── pre-commit # Script to run before each commit
├── init-env.sh # Initialize the environment.
│ └── pre-push # Script to run before each push
├── init_pwd.sh # Initialize or set password.
├── init_pwd.sh # Script to initialize password
├── install # Installation scripts directory.
├── install_im_compose.sh # Script to install IM with Docker Compose
│ ├── README.md # Installation documentation.
├── install-im-server.sh # Script to install IM server
│ ├── common.sh # Common utilities for installation.
├── lib # Library scripts
│ ├── dependency.sh # Script to install dependencies.
│ ├── color.sh # Script for console color manipulation
│ ├── environment.sh # Set up the environment during installation.
│ ├── golang.sh # Script for golang related utility functions
│ ├── install-protobuf.sh # Install Protocol Buffers.
│ ├── init.sh # Script for initialization tasks
│ ├── install.sh # Main installation script.
│ ├── logging.sh # Script for logging related utility functions
│ ├── openim-api.sh # Install OpenIM API.
│ ├── release.sh # Script for release related utility functions
│ ├── openim-crontask.sh # Install OpenIM crontask.
│ ├── util.sh # Script for generic utility functions
│ ├── openim-man.sh # Install OpenIM management tool.
│ └── version.sh # Script for versioning related tasks
│ ├── openim-msggateway.sh # Install OpenIM message gateway.
├── make-rules # Makefile rules
│ ├── openim-msgtransfer.sh # Install OpenIM message transfer.
│ ├── common.mk # Common Make rules
│ ├── openim-push.sh # Install OpenIM push service.
│ ├── copyright.mk # Copyright related Make rules
│ ├── openim-rpc.sh # Install OpenIM RPC.
│ ├── dependencies.mk # Dependencies related Make rules
│ ├── openim-tools.sh # Install OpenIM tools.
│ ├── gen.mk # Make rules for code generation
│ ├── test.sh # Installation testing script.
│ ├── golang.mk # Golang specific Make rules
│ └── vimrc # Vim configuration file.
│ ├── image.mk # Make rules for image building
├── install-im-server.sh # Script to install the OpenIM server.
│ ├── release.mk # Make rules for release process
├── install_im_compose.sh # Install OpenIM using Docker Compose.
│ ├── swagger.mk # Make rules for swagger documentation
├── lib # Library or utility scripts directory.
│ └── tools.mk # Make rules for tools and utilities
│ ├── chat.sh # Utilities related to chat.
├── mongo-init.sh # Script to initialize MongoDB
│ ├── color.sh # Color-related utilities.
├── openim-msggateway.sh # Script to start message gateway service
│ ├── golang.sh # Golang utilities.
├── openim-msgtransfer.sh # Script to start message transfer service
│ ├── init.sh # Initialization utilities.
├── path_info.sh # Script containing path information
│ ├── logging.sh # Logging utilities.
├── openim-push.sh # Script to start push service
│ ├── release.sh # Release related utilities.
├── release.sh # Script to perform release process
│ ├── util.sh # General utility functions.
├── start-all.sh # Script to start all services
│ └── version.sh # Version management utilities.
├── openim-crontask.sh # Script to start cron jobs
├── list-feature-tests.sh # Script to list feature tests.
├── openim-rpc.sh # Script to start RPC service
├── make-rules # Makefile rule templates.
├── stop-all.sh # Script to stop all services
│ ├── common.mk # Common make rules.
└── style_info.sh # Script containing style related information
│ ├── copyright.mk # Copyright related make rules.
│ ├── dependencies.mk # Dependency management rules.
│ ├── gen.mk # Generic or general rules.
│ ├── golang.mk # Golang-specific make rules.
│ ├── image.mk # Image or container-related rules.
│ ├── release.mk # Release specific rules.
│ ├── swagger.mk # Swagger documentation rules.
│ └── tools.mk # Tooling-related make rules.
├── mongo-init.sh # MongoDB initialization script.
├── release.sh # Script for releasing or deployment.
├── run-in-gopath.sh # Script to run commands within GOPATH.
├── start-all.sh # Script to start all services.
├── start.bat # Batch file to start services (usually for Windows).
├── stop-all.sh # Script to stop all services.
├── template # Directory containing template files.
│ ├── LICENSE # License template.
│ ├── LICENSE_TEMPLATES # Collection of license templates.
│ ├── boilerplate.txt # Boilerplate template.
│ ├── footer.md.tmpl # Footer template for markdown.
│ ├── head.md.tmpl # Header template for markdown.
│ └── project_README.md # Project README template.
├── update-generated-docs.sh # Update generated documentation.
├── update-yamlfmt.sh # Update YAML formatting.
├── verify-pkg-names.sh # Verify package names.
├── verify-shellcheck.sh # Shell script linting verification.
├── verify-spelling.sh # Spelling verification script.
├── verify-typecheck.sh # Type checking verification.
├── verify-yamlfmt.sh # Verify YAML format.
└── wait-for-it.sh # Script to wait for a condition or service to be ready.
```
```
The purpose of having a structured scripts directory like this is to make the operations of OpenIM Server clear and easy to manage. Each script has its own responsibility, making it easier to maintain and update. It's also helpful for newcomers who can easily understand what each part of the system is doing by just looking at this directory structure.
The purpose of having a structured scripts directory like this is to make the operations of OpenIM Server clear and easy to manage. Each script has its own responsibility, making it easier to maintain and update. It's also helpful for newcomers who can easily understand what each part of the system is doing by just looking at this directory structure.
@ -120,7 +149,7 @@ Is the `demo.sh` script teaching you how to quickly get started with OpenIM deve
Steps to run demo:
Steps to run demo:
```sh
```sh
make demo
$ make demo
```
```
More about `make` read:
More about `make` read:
@ -168,7 +197,7 @@ This function checks the status of services running on specified ports.
**Usage**:
**Usage**:
```bash
```bash
openim::util::check_ports < port1 > < port2 > ...
$ openim::util::check_ports < port1 > < port2 > ...
```
```
**Design**:
**Design**:
@ -182,7 +211,7 @@ openim::util::check_ports <port1> <port2> ...
#### Example:
#### Example:
```bash
```bash
openim::util::check_ports 8080 8081 8082
$ openim::util::check_ports 8080 8081 8082
```
```
### 2. Checking the Status of Services by Process Names
### 2. Checking the Status of Services by Process Names
@ -194,7 +223,7 @@ This function checks the status of services based on their process names.
**Usage**:
**Usage**:
```bash
```bash
openim::util::check_process_names < process_name1 > < process_name2 > ...
$ openim::util::check_process_names < process_name1 > < process_name2 > ...
```
```
**Design**:
**Design**:
@ -207,7 +236,7 @@ openim::util::check_process_names <process_name1> <process_name2> ...
#### Example:
#### Example:
```bash
```bash
openim::util::check_process_names nginx mysql redis
$ openim::util::check_process_names nginx mysql redis
```
```
### 3. Stopping Services by Ports
### 3. Stopping Services by Ports
@ -219,7 +248,7 @@ This function attempts to stop services running on the specified ports.
**Usage**:
**Usage**:
```bash
```bash
openim::util::stop_services_on_ports < port1 > < port2 > ...
$ openim::util::stop_services_on_ports < port1 > < port2 > ...
```
```
**Design**:
**Design**:
@ -232,7 +261,7 @@ openim::util::stop_services_on_ports <port1> <port2> ...
#### Example:
#### Example:
```bash
```bash
openim::util::stop_services_on_ports 8080 8081 8082
$ openim::util::stop_services_on_ports 8080 8081 8082
```
```
### 4. Stopping Services by Process Names
### 4. Stopping Services by Process Names
@ -244,7 +273,7 @@ This function attempts to stop services based on their process names.
**Usage**:
**Usage**:
```bash
```bash
openim::util::stop_services_with_name < process_name1 > < process_name2 > ...
$ openim::util::stop_services_with_name < process_name1 > < process_name2 > ...
```
```
**Design**:
**Design**:
@ -257,9 +286,14 @@ openim::util::stop_services_with_name <process_name1> <process_name2> ...
#### Example:
#### Example:
```bash
```bash
openim::util::stop_services_with_name nginx apache
$ openim::util::stop_services_with_name nginx apache
```
```
### system management and installation of openim via Linux system
```bash
$ ./scripts/install/install.sh
```
## examples
## examples
Scripts to perform various build, install, analysis, etc operations.
Scripts to perform various build, install, analysis, etc operations.