README.rst 2.19 KB
Newer Older
1
2
Expense tracking application built on the CubicWeb framework.
=============================================================
Nsukami Patrick's avatar
Nsukami Patrick committed
3
4
5
6
7
8
9
10
11

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.

Noé Gaumont's avatar
Noé Gaumont committed
12
Some useful commands:
Nsukami Patrick's avatar
Nsukami Patrick committed
13

Noé Gaumont's avatar
Noé Gaumont committed
14
- ``cubicweb-ctl db-create -a fresh`` will create and initialize the database
Nsukami Patrick's avatar
Nsukami Patrick committed
15

Noé Gaumont's avatar
Noé Gaumont committed
16
- ``cubicweb-ctl pyramid -D -l info fresh`` will start the instance on
Nsukami Patrick's avatar
Nsukami Patrick committed
17
18
  http://localhost:8080

Noé Gaumont's avatar
Noé Gaumont committed
19

Nsukami Patrick's avatar
Nsukami Patrick committed
20
21
22
Deploying on kubernetes
=======================

23
24
25
26
27
28
29
30
31
32
33
34
35
The file `deployment.yaml` contains several containers split in several
deployments:

- `nginx` to serve static files directly

- `fresh` to run the application (and compile the latest translation)

- an *initContainers* `upgrade` before `fresh` that upgrade the database schema
  if there is a new `fresh` version.

- `fresh-scheduler` to have the scheduler running.


Nsukami Patrick's avatar
Nsukami Patrick committed
36
37
38
39
40
41
42
43
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 -- \
44
      cubicweb-ctl db-create --automatic --create-db=n fresh
Nsukami Patrick's avatar
Nsukami Patrick committed
45
46
47
48
49
50
51
52
53
54
55
56
57
   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


58
59
60
61
62
63
64
65
66
You need to mount a cwclientlib configuration file to make
CWClientLibDataFeedParser. If you don't use this feature, just create an empty
file.

Create a file named cwclientlibrc and run::

   kubectl create secret generic fresh-cwclientlibrc --from-file=./cwclientlibrc


67
68
69
70
71
Create a persistent volume for bfss data::

   kubectl apply -f deploy/pvc.yaml


Nsukami Patrick's avatar
Nsukami Patrick committed
72
73
Then deploy fresh with::

74
   kubectl apply -f deploy/deployment.yaml