Skip to content

Commit

Permalink
Merge pull request #3 from a631953720/v0.2.0-beta
Browse files Browse the repository at this point in the history
V0.2.0 beta
  • Loading branch information
a631953720 authored Jul 9, 2022
2 parents e959cec + a6bf9ef commit 5826657
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
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

0 comments on commit 5826657

Please sign in to comment.