diff --git a/Dockerfile b/Dockerfile index 9f2e3a7..639b420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,6 @@ WORKDIR /home/zendesk USER zendesk COPY --from=build /app/zendesk/bin/app . +COPY --from=build /app/zendesk/data ./data CMD [ "/home/zendesk/app" ] diff --git a/README.md b/README.md index 479e93b..24b61e9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ # Zendesk Code Challenge +## How to + +### How to run + +```bash + +./auto/run + +``` + +Or without Docker + +```bash + +go run main.go + +``` + +Please use your arrow keys to select search data type and field name from all fields, then type the value for that field. + +If there are something matched, the application will printed out all the information, including linked `User` and `Organisation` information. + +Otherwise you should expect a error message says `Cannot find any matched result` + + Notice: Due to the limited time, currently you can't go back in the CLI, if you want to skip the current search then just type `Enter`. + + + +### How to test + +```bash + +./auto/test + +``` + +Or without Docker + +```bash + +go test ./... -cover + +``` + +### How to build Docker image + +```bash + +GITHUB_RUN_NUMBER=1 ./auto/build + +``` diff --git a/auto/run b/auto/run new file mode 100755 index 0000000..3430373 --- /dev/null +++ b/auto/run @@ -0,0 +1,5 @@ +#!/bin/bash -eu + +cd $(dirname $0)/.. + +docker-compose run app