forked from ChicagoBoss/ChicagoBoss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README_UPGRADE
150 lines (99 loc) · 5.37 KB
/
README_UPGRADE
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Upgrade: From anything to 0.7.2
-------------------------------
Custom tags should be moved from view/lib/ to view/lib/tag_html.
Upgrade: From 0.6 to 0.7
------------------------
In Chicago Boss 0.7, projects are now rebarified, boss.config is the central place for all configuration and eunit testing has been made easy,
bc. ./rebar boss # (list of available commands)
./init.sh # (list of available boot commands)
h3. Migrate current cb apps
In order to ease the task, a new make task has been created in the framework Makefile, just update your Chicago Boss and run:
bc. make rebarize APPDIR=/path/to/app
This will copy all new files in your app directory, move the app.src file to src, move the boss_web_tests (functionals) to src/test/functional and point you with instructions on what you need add to your boss.config.
bc. make rebarize APPDIR=../my_app
../my_app rebar-boss-ified
WARNING: your boss.config have not been changed, you need to set:
- in boss app section:
---- {path, "/path/to/chicago_boss"}
---- {vm_cookie, "my_secret_cookie"} % Optional, defaults to abc123
- for each app defined:
---- {path, "../path/to/app"}
INFO: you can safely remove the Makefile and start* files from your app dir
INFO: after the boss.config change, you can run:
cd ../my_app
./rebar boss # Shows all boss-rebar commands
./init.sh # Shows the new boot system commands
h3. Compilation
Boss has non-standard-compatible-rebar-way of compiling code, the rebar plugin switches off standard compilation and calls the boss_load module.
./rebar compile (works for compatibility mode)
./rebar boss c=compile
h3. Configuration
Now the only file on a cb project you need to take care is boss.config, the new init.sh calls ./rebar boss commands that returns automatically generated erl -pa... commands and executes it.
You now defines the path in boss.config for each app and (compilation, test launch, start, stop, reload, ...) works automatically.
A new setting in boss.config called vm_cookie (optional) has been added, used in start/stop/reload commands (defaults to "abc123"):
bc. [{boss, [ {path, "../ChicagoBoss"}, {vm_cookie, "abc123"}, ...
h3. Tests
Eunit testing compilation/setup works automatically, start writing unit tests, just place them in "src/test/eunit" and run ./rebar eunit or ./rebar boss c=test_eunit
Functional tests lives now in src/test/functional (before was placed in src/test), just call ./rebar boss c=test_functional
h3. Init
The init.sh handles start, start-dev as before, but also stop, reload (hot for the node) and restart is implemented.
Now we can tweak, change, make vm.args configurable (in boss.config) without force developers to handle this manually in their apps.
Upgrade: From 0.5 to 0.6
------------------------
Starting with Chicago Boss 0.6, projects follow an OTP layout, and the admin
interface is a standalone OTP application.
To upgrade, you will need to do the following in your project:
mkdir src
mkdir priv
mv controller/ init/ lib/ mail/ model/ test/ view/ src/
mv lang/ static/ priv/
PROJECT=my_application mv boss.routes priv/$PROJECT.routes
In addition, you will need to prefix your controller modules with the application
name. E.g.
mv blog_controller.erl my_application_blog_controller.erl
This avoids module naming conflicts when multiple applications are installed on
the same server (which was not possible prior to 0.6).
Upgrade: From 0.5.x to 0.5.y
----------------------------
Starting with Chicago Boss 0.5, the framework source is kept separate from your
project source. After downloading and building a new copy of CB, you need to update
your server scripts to point to the new source. Open "start-dev.sh" and "start.sh"
and make sure there is an argument like this:
-pa /path/to/new/ChicagoBoss/ebin
You might also want to update your /admin interface by copying the "skel/admin"
directory from the new CB over to your project directory.
Upgrade: From 0.4 to 0.5
------------------------
The easiest way to upgrade from 0.4 is to create a new CB app and copy your source
into it. In the CB source directory, type:
make
make app PROJECT=mynewproject
cd ../mynewproject
cp -a /path/to/existing/project/view \
/path/to/existing/project/model \
/path/to/existing/project/controller \
/path/to/existing/project/static \
/path/to/existing/project/boss.config \
.
Then start the server with ./start-dev.sh
Upgrade: From 0.4.x to 0.4.y
----------------------------
Starting with Chicago Boss 0.4, application upgrades are as simple as:
cp -a /path/to/old/ChicagoBoss/[a-z]* .
In general, files in the project directory that start with an upper-case letter
belong to Boss. Files which start with a lower-case letter belong to you.
Upgrade: From 0.3 to 0.4
------------------------
The directory structure has changed somewhat. The MVC files have moved around, and
files for the /admin interface are in a separate directory (ADMIN).
The following steps should get you most of the way to an upgrade:
cp -a /path/to/old/ChicagoBoss/boss.config .
cp -a /path/to/old/ChicagoBoss/Web/*_controller.erl controller/
rm controller/admin_controller.erl
cp -a /path/to/old/ChicagoBoss/Web/*.erl lib/
cp -a /path/to/old/ChicagoBoss/Model/* model/
cp -a /path/to/old/ChicagoBoss/Web/*_views view/
rm -r view/admin_views
cp -a /path/to/old/ChicagoBoss/static/* static/
make clean
make