readme.md 2.6 KB
Newer Older
Aral Balkan's avatar
Aral Balkan committed
1
2
3
# Blockdown Builder

Builds the blockdown data from the blockdown content.
4

5
## Development
6

7
	./install
8

9
To use, run:
10

11
	./dev
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Usage

To see the site, visit `http://localhost:3000`

To update (locally):

  1. Make a change to a Blockdown file in *~/ind.ie.blockdown-builder/content/*
  2. `git commit -am "Your change"`
  3. `git push`

At this point, your commit will simulate the Gitlab web hook that the production environment uses and trigger the Blockdown build process. That, in turn, will push to the local site.

Visit `http://localhost:3000` to see the updated site and *~/ind.ie.blockdown-builder/site-local/blockerList.json* for the updated WebKit blocker list.

## Production
28

29
(I’m sorry there isn’t a more automated process at the moment. Configuration of the deployment environment involves the manual set up and configuration of a number of servers and Git repositories at the moment.)
30
31

1. Set up server with Dokku.
32

33
2. Copy `config.coffee` into `~/ind.ie.blockdown-builder` (`/root/ind.ie.blockdown-builder/`) and configure it.
34

35
3. In the folder from Step 2, above, `git clone git@source.ind.ie:blockdown/content.git`
36

37
38
4. ./deploy

39
40
41
5. Create the volumes:

		dokku docker-options:add blockdown-builder.ind.ie run "-v /root/ind.ie.blockdown-builder:/app/ind.ie.blockdown-builder"
42

43
6. Clone the data and theme repositories (you must first create the data folders, initialise with a basic readme.md):
44
	i. `cd ~/ind.ie.blockdown-builder/`
45
46
47
48
49
	ii. `git clone git@source.ind.ie:blockdown/data-for-apps.git`
	ii. `git clone git@source.ind.ie:blockdown/data-for-site.git`
	iii. `git clone git@source.ind.ie:blockdown/theme-for-app-data.git`
	iv. `git clone git@source.ind.ie:blockdown/theme-for-site-data.git`
	v. `git clone git@source.ind.ie:blockdown/content.git`
50

51
7. In the data-for-site repository: `git remote add site git@blockdown-site.ind.ie:data.git`
52

53
8. Set up post-push and post-merge webhooks on Gitlab for the Content, Theme-For-Site-Data, and Theme-For-App-Data repositories to point to `https://url/for/your/installation/build/(token-from-config.coffee)`
54

55
56
57
58
59
60
61
62
9. Add your ssh key for the Blockdown repositories to `~/ind.ie.blockdown-builder/ssh` as `id_rsa` and `id_rsa.pub`.


# Site deployment

For blockdown-site.ind.ie:

1. Create a git account.
63
64
65
2. Add the blockdown-builder.ind.ie SSH keys to the account’s `~/.ssh` folder.
3. In ~, `git clone --bare git@source.ind.ie:blockdown/data-for-site.git data.git`
4. In ~, `git clone data.git site`
66
5. From blockdown-builder.ind.ie, make sure you run Step 7, above to add data.git as a remote.
67
6. Make sure that the post-receive hook is in /home/git/data.git/hooks (see Site repository)