/gbookshelf

Manage your bookshelf

Primary LanguageJavaScriptApache License 2.0Apache-2.0

gbookshelf

Manage your bookshelf to tackle a problem of many piled books which you would never read a.k.a. Tundoku.

Go Report Card Go Doc Release

Usage

Super WIP: Currently it is pretty much useless.

Install Commands

make install

Run Bookshelf Server

export GBOOKSHELF_BOOKSHELF=<Your bookshelf name (= Root Collection Name in Firestore Database)>; \
export GBOOKSHELF_SERVER_PORT=2109; \
export GBOOKSHELF_METRICS_PORT=2112; \
export PROJECT_ID=<Project ID>; \
export GCLOUD_CRENTIAL_FILE_PATH=$(pwd)/deployments/base/.credentials/gbookshelf-firebase-adminsdk.json; \
gbookshelf-server # in a terminal

Access bookshelf

See help generated by cobra.

gbsctl # in another terminal
gbsctl help [command]

Test

make \
PROJECT_ID=<Project ID> \
FIRESTORE_ADMINSDK_CRENTIAL_FILE_PATH=$(pwd)/deployments/base/.credentials/gbookshelf-firebase-adminsdk.json \
test

Build & Run

make build
make \
GBOOKSHELF_BOOKSHELF=<Your bookshelf name (= Root Collection Name in Firestore Database)> \
PROJECT_ID=<Project ID> \
FIRESTORE_ADMINSDK_CRENTIAL_FILE_PATH=</path/to/credentials> \
run

Local build with cloud-build-local

make build-local

Submit container image to GCR

make submit

Run submitted container image on local

make submit
make \
GBOOKSHELF_BOOKSHELF=<Your bookshelf name (= Root Collection Name in Firestore Database)> \
PROJECT_ID=<Project ID> \
FIRESTORE_ADMINSDK_CRENTIAL_FILE_PATH=$(pwd)/deployments/base/.credentials/gbookshelf-firebase-adminsdk.json \
run-gcp

Deploy

make tf-apply \
&& make \
ALERTMANAGER_SLACK_CHANNEL=<your channel name including '#'> \
ALERTMANAGER_SLACK_WEB_HOOK=<your slack incoming webhook url> \
kube-apply

Access Services

GBOOKSHELF_ENV=dev; sudo kubefwd services --namespace ${GBOOKSHELF_ENV}-gbookshelf
GBOOKSHELF_ENV=dev; kubectl port-forward $(kubectl get pods --namespace ${GBOOKSHELF_ENV}-gbookshelf -l "name=gbookshelf-server" -o jsonpath="{.items[0].metadata.name}") 8080:8080 --namespace ${GBOOKSHELF_ENV}-gbookshelf
gbsctl list

Destroy

make kube-delete
make tf-destroy

References