fix: images bug find tput in make demo (#918)

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/915/head
Xinwei Xiong 1 year ago committed by GitHub
parent 58f591e5f6
commit 73c4b68052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
.env

@ -1,3 +1,17 @@
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
USER=root USER=root
PASSWORD=openIM123 PASSWORD=openIM123
MINIO_ENDPOINT=http://127.0.0.1:10005 MINIO_ENDPOINT=http://127.0.0.1:10005

@ -1,6 +1,6 @@
# Copyright © 2023 OpenIM. All rights reserved. # Copyright © 2023 OpenIM. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
@ -13,7 +13,10 @@
# limitations under the License. # limitations under the License.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Infrastructural configurations, please modify based on your setup # TODO: This config file is the template file
# --| source: deployments/templates/openim.yaml
# --| env: scripts/install/environment
# --| target: config/config.yaml
# ----------------------------------------------------------------- # -----------------------------------------------------------------
###################### Zookeeper ###################### ###################### Zookeeper ######################
@ -64,7 +67,7 @@ mongo:
password: openIM123 password: openIM123
maxPoolSize: 100 maxPoolSize: 100
###################### Redis ###################### ###################### Redis configuration information ######################
# Redis configuration # Redis configuration
# #
# Username is required only for Redis version 6.0+ # Username is required only for Redis version 6.0+
@ -73,7 +76,7 @@ redis:
username: username:
password: openIM123 password: openIM123
###################### Kafka ###################### ###################### Kafka configuration information ######################
# Kafka configuration # Kafka configuration
# #
# Kafka username # Kafka username
@ -96,7 +99,7 @@ kafka:
msgToMySql: mysql msgToMySql: mysql
msgToPush: push msgToPush: push
###################### RPC ###################### ###################### RPC configuration information ######################
# RPC configuration # RPC configuration
# #
# IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway # IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway
@ -105,7 +108,7 @@ rpc:
registerIP: registerIP:
listenIP: 0.0.0.0 listenIP: 0.0.0.0
###################### API ###################### ###################### API configuration information ######################
# API configuration # API configuration
# #
# API service port # API service port
@ -114,7 +117,7 @@ api:
openImApiPort: [ 10002 ] openImApiPort: [ 10002 ]
listenIP: 0.0.0.0 listenIP: 0.0.0.0
###################### Gateway ###################### ###################### Object configuration information ######################
# Object storage configuration # Object storage configuration
# #
# Use minio for object storage # Use minio for object storage
@ -150,11 +153,12 @@ object:
accessKeySecret: "" accessKeySecret: ""
sessionToken: "" sessionToken: ""
###################### RPC Port Configuration ######################
# RPC service ports # RPC service ports
# These ports are passed into the program by the script and are not recommended to modify # These ports are passed into the program by the script and are not recommended to modify
# For launching multiple programs, just fill in multiple ports separated by commas # For launching multiple programs, just fill in multiple ports separated by commas
# For example, [10110, 10111] # For example, [10110, 10111]
rpcPort: rpcPort:
openImUserPort: [ 10110 ] openImUserPort: [ 10110 ]
openImFriendPort: [ 10120 ] openImFriendPort: [ 10120 ]
openImMessagePort: [ 10130 ] openImMessagePort: [ 10130 ]
@ -165,6 +169,7 @@ rpcPort:
openImConversationPort: [ 10180 ] openImConversationPort: [ 10180 ]
openImThirdPort: [ 10190 ] openImThirdPort: [ 10190 ]
###################### RPC Register Name Configuration ######################
# RPC service names for registration, it's not recommended to modify these # RPC service names for registration, it's not recommended to modify these
rpcRegisterName: rpcRegisterName:
openImUserName: User openImUserName: User
@ -177,6 +182,7 @@ rpcRegisterName:
openImConversationName: Conversation openImConversationName: Conversation
openImThirdName: Third openImThirdName: Third
###################### Log Configuration ######################
# Log configuration # Log configuration
# #
# Storage directory # Storage directory
@ -191,10 +197,11 @@ log:
rotationTime: 24 rotationTime: 24
remainRotationCount: 2 remainRotationCount: 2
remainLogLevel: 6 remainLogLevel: 6
isStdout: false isStdout: false
isJson: false isJson: false
withStack: false withStack: false
###################### Variables definition ######################
# Long connection server configuration # Long connection server configuration
# #
# Websocket port for msg_gateway # Websocket port for msg_gateway
@ -236,8 +243,8 @@ push:
# Built-in app manager user IDs # Built-in app manager user IDs
# Built-in app manager nicknames # Built-in app manager nicknames
manager: manager:
userID: [ "openIM123456","openIM654321","openIMAdmin" ] userID: [ "openIM123456", "openIM654321", "openIMAdmin" ]
nickname: [ "system1","system2", "system3" ] nickname: [ "system1", "system2", "system3" ]
# Multi-platform login policy # Multi-platform login policy
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time # For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
@ -291,6 +298,7 @@ iosPush:
badgeCount: true badgeCount: true
production: false production: false
###################### Third-party service configuration ######################
# Callback configuration # Callback configuration
# #
# Callback URL # Callback URL
@ -360,7 +368,7 @@ callback:
failedContinue: true failedContinue: true
###################### Prometheus ###################### ###################### Prometheus ######################
# Prometheus configuration # Prometheus configuration for various services
# The number of Prometheus ports per service needs to correspond to rpcPort # The number of Prometheus ports per service needs to correspond to rpcPort
# The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh # The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh
prometheus: prometheus:
@ -375,4 +383,4 @@ prometheus:
conversationPrometheusPort: [ 20230 ] conversationPrometheusPort: [ 20230 ]
rtcPrometheusPort: [ 21300 ] rtcPrometheusPort: [ 21300 ]
thirdPrometheusPort: [ 21301 ] thirdPrometheusPort: [ 21301 ]
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # List of ports

@ -198,7 +198,7 @@ log:
rotationTime: ${LOG_ROTATION_TIME} rotationTime: ${LOG_ROTATION_TIME}
remainRotationCount: ${LOG_REMAIN_ROTATION_COUNT} remainRotationCount: ${LOG_REMAIN_ROTATION_COUNT}
remainLogLevel: ${LOG_REMAIN_LOG_LEVEL} remainLogLevel: ${LOG_REMAIN_LOG_LEVEL}
isStdout: ${LOG_IS_STDOUT} isStdout: ${LOG_IS_STDOUT}
isJson: ${LOG_IS_JSON} isJson: ${LOG_IS_JSON}
withStack: ${LOG_WITH_STACK} withStack: ${LOG_WITH_STACK}

@ -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.

@ -13,46 +13,83 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
readonly t_reset=$(tput sgr0)
readonly green=$(tput bold; tput setaf 2)
readonly yellow=$(tput bold; tput setaf 3)
readonly blue=$(tput bold; tput setaf 6)
readonly timeout=$(if [ "$(uname)" == "Darwin" ]; then echo "1"; else echo "0.1"; fi)
readonly ipv6regex='(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))'
clear clear
. $(dirname ${BASH_SOURCE})/lib/util.sh . $(dirname ${BASH_SOURCE})/lib/util.sh
trap 'openim::util::onCtrlC' INT trap 'openim::util::onCtrlC' INT
openim::util::desc "========> Welcome to the OpenIM Demo" function openim::util::onCtrlC() {
openim::util::desc "========> We'll help you get started with OpenIM quickly" echo -e "\n${t_reset}Ctrl+C Press it. It's exiting openim make init..."
openim::util::desc "========> Press Enter to continue...." exit 0
openim::util::run "make advertise" }
# openim::util::desc "========> Welcome to the OpenIM Demo"
# openim::util::desc "========> We'll help you get started with OpenIM quickly"
# openim::util::desc "========> Press Enter to continue...."
# openim::util::run "make advertise"
# clear
# openim::util::desc "========> Initialize the project and generate configuration files"
# openim::util::run "make init"
# openim::util::desc "========> You can look git diff"
# openim::util::run "git diff"
# clear
# openim::util::desc "You can learn a lot about automation using make help"
# openim::util::run "make help"
# clear
# openim::util::desc "You can learn a lot about automation using make help-all"
# openim::util::run "make help-all"
# clear
# openim::util::desc "First, let's verify and install some necessary tools"
# openim::util::run "make tools"
# clear
# openim::util::desc "The specification is pretty high, you need to be bound on your branch name, as well as commit messages"
# openim::util::run "git commit -a -s -m 'feta: commit demo against specification'"
# openim::util::run "# git commit -a -s -m 'feat: commit demo against specification' --amend"
# clear
# openim::util::desc "How did we teach you how to build OpenIM"
# openim::util::desc "A full build startup check"
# openim::util::run "# make all"
# clear
# openim::util::desc "Build one OpenIM binary"
# openim::util::desc "BINS: openim-api openim-cmdutils openim-crontask openim-msggateway openim-msgtransfer openim-push openim-rpc changelog infra ncpu yamlfmt"
# openim::util::run "make build BINS=openim-api"
# openim::util::desc "Build binaries for all platforms"
# openim::util::run "make multiarch -j BINS=openim-crontask PLATFORMS='linux_arm64 linux_amd64' "
# openim::util::desc "If you wish to use dlv for debugging, either binary or process"
# openim::util::desc "You need to enable debug mode"
# openim::util::run "make build BINS=openim-cmdutils DEBUG=1"
# clear
openim::util::desc "Next, let's learn how to start the OpenIM service. For starting, we have two ways"
openim::util::desc "The first is Background startup"
openim::util::run "make start"
openim::util::desc "The second way is through the Linux system way"
openim::util::run "./scripts/install/install.sh --help"
clear clear
openim::util::desc "========> Initialize the project and generate configuration files" openim::util::desc "Next, let's learn how to check the OpenIM service. For checking, we have two ways"
openim::util::run "make init" openim::util::run "make check"
openim::util::desc "========> You can look git diff"
openim::util::run "git diff"
clear clear
openim::util::desc "You can learn a lot about automation using make help" openim::util::desc "Next, let's learn how to stop the OpenIM service. For stopping, we have two ways"
openim::util::run "make help" openim::util::run "make stop"
clear
openim::util::desc "You can learn a lot about automation using make help-all"
openim::util::run "make help-all"
clear
openim::util::desc "How did we teach you how to build OpenIM"
openim::util::desc "A full build startup check"
openim::util::run "make all"
openim::util::desc "Build one OpenIM binary"
openim::util::desc "BINS: openim-api openim-cmdutils openim-crontask openim-msggateway openim-msgtransfer openim-push openim-rpc changelog infra ncpu yamlfmt"
openim::util::run "make build BINS=openim-api"
openim::util::desc "Build binaries for all platforms"
openim::util::run "make multiarch -j BINS=openim-api PLATFORMS='linux_arm64 linux_amd64' "
openim::util::desc "If you wish to use dlv for debugging, either binary or process"
openim::util::desc "You need to enable debug mode"
openim::util::run "make build BINS=openim-api DEBUG=1"
clear clear
openim::util::desc "Run tidy to format and fix imports" openim::util::desc "Run tidy to format and fix imports"
@ -60,22 +97,22 @@ openim::util::run "make tidy"
clear clear
openim::util::desc "Vendor go.mod dependencies" openim::util::desc "Vendor go.mod dependencies"
openim::util::run "make vendor" openim::util::run "# make vendor"
clear clear
openim::util::desc "Run unit tests" openim::util::desc "Run unit tests"
openim::util::run "make test" openim::util::run "# make test"
clear clear
openim::util::desc "Run unit tests and get test coverage" openim::util::desc "Run unit tests and get test coverage"
openim::util::run "make cover" openim::util::run "# make cover"
clear clear
openim::util::desc "Check for updates to go.mod dependencies" openim::util::desc "Check for updates to go.mod dependencies"
openim::util::run "make updates" openim::util::run "# make updates"
clear clear
openim::util::desc "Clean all generated files" openim::util::desc "You can learn a lot about automation using make clean, remove all files that are created by building"
openim::util::run "make clean" openim::util::run "make clean"
clear clear

@ -69,17 +69,6 @@ UNDERLINE_PREFIX="\033[4m" # Underline prefix
ITALIC_PREFIX="\033[3m" # Italic prefix ITALIC_PREFIX="\033[3m" # Italic prefix
CYAN_PREFIX="\033[0;36m" # Cyan prefix CYAN_PREFIX="\033[0;36m" # Cyan prefix
# --- make demo (run demo) ---
reset=$(tput sgr0)
bold=$(tput bold)
black=$(tput setaf 0)
red=$(tput setaf 1)
green=$(tput bold; tput setaf 2)
yellow=$(tput bold; tput setaf 3)
blue=$(tput bold; tput setaf 6)
timeout=$(if [ "$(uname)" == "Darwin" ]; then echo "1"; else echo "0.1"; fi)
# Print colors you can use # Print colors you can use
openim::color::print_color() openim::color::print_color()
{ {

Loading…
Cancel
Save