blob: b8eae6794db07b5d9af4d9985d050c447e8cee1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# No6092
Charles Stankievech
## Installation
```bash
npm install -g yarn
yarn install
```
## Development
To run the server:
```bash
yarn server
```
The server will be running on http://localhost:3000/ and the admin pages are on http://localhost:3000/admin/
When you start editing, be sure to pull the most recent changes before you do anything:
```bash
git pull
```
If you add any new files, add them so git will keep track of them:
```bash
git add -A
```
Commit changes with git, and then push them:
```bash
git commit -am "adding some changes"
git push
```
Always please commit and push when you stop working! Otherwise we might have merge conflicts and it will be annoying :)
## Production
To log into the server, simply `ssh km@km`
The site runs in production using `pm2`.
### Starting the first time
If the server ever restarts, you can restart the KM site this way:
```bash
pm2 start index.js --name km
```
### Synchronizing
You should not update your database locally if you can help it. If this cannot be avoided, log into the server first, commit changes there and then push them. Then pull locally, which will update your database with the latest changes.
To synchronize images with the server, run this command at any time:
```bash
yarn sync
```
### Updating the site
First, push your local changes:
```bash
yarn sync
git commit -am 'updating the database'
git push
```
Then on the server, pull changes and restart it:
```bash
ssh km@km
cd km-galerie
git pull
pm2 restart km
```
|