Skip to content

Latest commit

 

History

History
146 lines (96 loc) · 4.34 KB

BUILD.md

File metadata and controls

146 lines (96 loc) · 4.34 KB

Building watermint toolbox

Prerequisites

  • Register your own application on Dropbox's developer site for each required application type.
  • Place application keys into the file.

Desktop development environment

Place JSON file named toolbox.appkeys under resources folder, then run or compile binaries. toolbox.appkeys file format is like below:

{
  "user_full.key": "xxxxxxxxxxxxxx",
  "user_full.secret": "xxxxxxxxxxxxxx",
  "business_info.key": "xxxxxxxxxxxxxx",
  "business_info.secret": "xxxxxxxxxxxxxx",
  "business_file.key": "xxxxxxxxxxxxxx",
  "business_file.secret": "xxxxxxxxxxxxxx",
  "business_management.key": "xxxxxxxxxxxxxx",
  "business_management.secret": "xxxxxxxxxxxxxx",
  "business_audit.key": "xxxxxxxxxxxxxx",
  "business_audit.secret": "xxxxxxxxxxxxxx"
}

On CI environment (GitHub Actions)

  1. TOOLBOX_APPKEYS:

TOOLBOX_APPKEYS is for define app keys and app secrets of web services.

{"user_full.key":"xxxxxxxxxxxxxx","user_full.secret":"xxxxxxxxxxxxxx","business_info.key":"xxxxxxxxxxxxxx","business_info.secret":"xxxxxxxxxxxxxx","business_file.key":"xxxxxxxxxxxxxx","business_file.secret":"xxxxxxxxxxxxxx","business_management.key":"xxxxxxxxxxxxxx","business_management.secret":"xxxxxxxxxxxxxx","business_audit.key":"xxxxxxxxxxxxxx","business_audit.secret":"xxxxxxxxxxxxxx"}
  1. TOOLBOX_BUILDERKEY:

TOOLBOX_BUILDERKEY is for the seed to obfuscate secrets. Please choose random string

  1. TOOLBOX_DEPLOY_TOKEN:

TOOLBOX_DEPLOY_TOKEN is for deploy compiled packages into Dropbox. Please run tbx dev ci artifact connect command to create token data.

  1. TOOLBOX_REPLAY_URL:

TOOLBOX_REPLAY_URL is for retrieve replay data from the shared link.

  1. TOOLBOX_BUILD_TARGET:

TOOLBOX_BUILD_TARGET is for specify build target. The build target is the combination of os/arch like windows/amd64, darwin/amd64, linux/amd64, etc.

Docker build

To build an executable, please use Docker like below.

$ docker-compose -f docker-compose.yml build && docker-compose -f docker-compose.yml run build

Enhance code

Documentation

Most documents are generated by the command dev doc. And most text resources are managed under resource file /resources/messages.json.

For example, README.md, on top of this project, is also generated from the template /resources/README.tmpl.md. And related text are managed with key prefix doc.readme.

Message keys and convention

toolbox rely on message resource file to internationalize all texts and UI messages. Therefore all message required to add into the resource file (/resources/messages.json).

To minimize code configuration, there is a naming convention & framework for typical messages. For example, keys for recipes and their value objects are automatically mapped based on their type package name, type name, and field names. If there a recipe named file/Copy.go, and the value object file/CopyVO. Then those names are mapped into file.copy.<key>, and file.copy_vo.<key>.

Before commit

Please run command dev build preflight to ensure all message resources and documents are available.

$ cd /path/to/PROJECT_ROOT
$ go run tbx.go dev build preflight

Test process

End to end test

Please run below command to prepare end to end testing. Tests should pass without this step.

$ cd /path/to/PROJECT_ROOT
$ go run tbx.go dev ci auth connect

Run all tests

To run all tests, please reduce concurrency to 1. Because some test are stateful for Dropbox accounts.

$ cd /path/to/PROJECT_ROOT
$ go test -p 1 ./...

Release process

Release information

Update following files

  • resources/release/release ... Release number
  • resources/release/release_notes ... Release notes

Release candidate

Please run command dev release candidate to verify & update resources for release ready.

$ cd /path/to/PROJECT_ROOT
$ go run tbx.go dev release candidate 

Publish Release

Please run command dev release publish to upload assets on to the github account, and create draft releases.

$ cd /path/to/PROJECT_ROOT
$ go run tbx.go dev release publish 

Project page

Preview

$ docker run --rm --volume="$(pwd):/srv/jekyll" -p 4000:4000 jekyll/jekyll:stable jekyll serve --config /srv/jekyll/docs/_config.yml,/srv/jekyll/docs/_config_dev.yml --destination /tmp/staging --source /srv/jekyll/docs --watch