# HG changeset patch # User Nsukami Patrick <ndkpatt at gmail dot com> # Date 1557994281 0 # Thu May 16 08:11:21 2019 +0000 # Node ID cc77e09651c26fa5d1ff708e98a733baa2ae4bbe # Parent cb8d771b53756adb10a214aedf4c2eae57e41b3c Update README file diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -1,2 +1,47 @@ Expense tracking application built on the CubicWeb framework. ============================================================= + +Developping with docker +======================= + +Assuming you have a postgresql running on your machine where you can connect +with peer authentication, run "make dev" it will spawn an interactive shell +inside a docker container with the code mounted in develop mode. It mean you +can edit the code locally and run it in the container. + +Some useful commands:: + +* ``cubicweb-ctl db-create -a fresh`` will create and initialize the + database + +* ``cubicweb-ctl pyramid -D -l info fresh`` will start the instance on + http://localhost:8080 + +Deploying on kubernetes +======================= + +To create the initial database from an existing empty database:: + + kubectl run -it fresh-dbcreate \ + --env CW_DB_HOST=db \ + --env CW_DB_USER=user \ + --env CW_DB_PASSWORD=pass \ + --env CW_DB_NAME=fresh \ + --image=hub.extranet.logilab.fr/logilab/fresh --command -- \ + cubicweb-ctl db-create --automatic --create-db=n fresh + kubectl delete deployment fresh-dbcreate + + +Then generate a secret named "fresh" from where environment variables are set:: + + kubectl create secret generic fresh-env \ + --from-literal CW_DB_HOST=db + --from-literal CW_DB_USER=user \ + --from-literal CW_DB_PASSWORD=pass \ + --from-literal CW_DB_NAME=fresh \ + --from-literal CW_BASE_URL=https://fresh.example.com + + +Then deploy fresh with:: + + kubectl apply -f deployment.yaml