Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.2.0 beta #3

Merged
merged 5 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ steps:
trigger:
branch:
- main
- drone-deploy
event:
- push
- tag
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,22 @@ you can see the container is runninng like as follow.
![image](https://user-images.githubusercontent.com/51738970/178057363-1351be0d-16a9-460a-a8dd-57ab86c0653b.png)

## 4. API test
you can reference [Test the API can parse data](https://github.com/a631953720/thingsboard-sendbox/blob/main/README.md#4-test-the-api-can-parse-data)
you can reference [Test the API can parse data](#4-test-the-api-can-parse-data)

# Customzied the docker
## `release/.env` can control all the docker image config
```env
# project build
OUTPUT_FOLDER=output # create folder in root path
OUTPUT_IMAGE_FILE_NAME=thingsboard-sendbox

# deploy
DEPLOY_VERSION=v0.2.0-beta
DEPLOY_PORT=8000
SERVER_LISTEN=8000 # must equal to the "config.json" at root folder

# docker
IMAGE_NAME=thingsboard-sendbox
CONTAINER_NAME=thingsboard-sendbox

```
2 changes: 2 additions & 0 deletions release/rewrite_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ copy_config="../config.origin.json"
yellow_printf "rename origin config.json"
mv ${config} ${copy_config}

# make sure that the production flag is 'true'
# it can don't need to modify the config file every drone deploy
yellow_printf "rewrite the config file to production"
rewrite_config_file ${copy_config} ${config}
green_printf "convert the 'production' flag to 'true'"
6 changes: 4 additions & 2 deletions release/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ function load_dot_env() {
yellow_printf "------ read env end ------"
}

# 會逐行讀取取得屬性值,只能取得單純的字串、數字或布林
# 如果重複,只會回傳第一個找到的值
# will read the file line by line
# only can get string, number, and boolean
# only return the first result
function find_json_value() {
while read -r LINE; do
# can ignore
Expand All @@ -48,6 +49,7 @@ function find_json_value() {
echo $REAULT
}

# this function case only for this project situation
function rewrite_config_file() {
target_file=$1
new_file=$2
Expand Down