Show More
@@ -1,179 +1,206 b'' | |||
|
1 | 1 | .. _dev-setup: |
|
2 | 2 | |
|
3 | 3 | ======================== |
|
4 | 4 | Setup of Development env |
|
5 | 5 | ======================== |
|
6 | 6 | |
|
7 | ||
|
7 | These instructions are meant for developing RhodeCode from source code. | |
|
8 | 8 | To setup a development environment with all needed services for development follow the below actions: |
|
9 | 9 | |
|
10 | 10 | |
|
11 | define dev workspace home | |
|
12 | +++++++++++++++++++++++++ | |
|
13 | ||
|
14 | Setup env variable WORKSPACE_HOME to your absolute path where you repositories for dev are stored. e.g | |
|
15 | ||
|
16 | example: | |
|
17 | ||
|
18 | `WORKSPACE_HOME=/media/psf/Home/workspace` | |
|
19 | ||
|
20 | Set this on bash: | |
|
21 | ||
|
22 | .. code-block:: bash | |
|
23 | ||
|
24 | export WORKSPACE_HOME=/media/psf/Home/workspace | |
|
25 | ||
|
26 | ||
|
11 | 27 | get rcstack & docker |
|
12 | 28 | ++++++++++++++++++++ |
|
13 | 29 | |
|
14 | To quickly get and install rcstack run this command | |
|
30 | To quickly get and install latest rcstack run this command | |
|
15 | 31 | |
|
16 | 32 | .. code-block:: bash |
|
17 | 33 | |
|
18 | mkdir rhodecode-docker && cd rhodecode-docker | |
|
19 | curl -L -s -o rcstack https://dls.rhodecode.com/get-rcstack && chmod +x rcstack | |
|
34 | # create the rhodecode-docker dir, and cd into it | |
|
35 | mkdir -p $WORKSPACE_HOME/rhodecode-docker && cd $WORKSPACE_HOME/rhodecode-docker | |
|
36 | ||
|
37 | # get latest rcstack | |
|
38 | curl -L -s -o rcstack https://code.rhodecode.com/rhodecode-enterprise-docker/raw/master/scripts/rcstack/rcstack && chmod +x rcstack | |
|
39 | ||
|
20 | 40 | ./rcstack init |
|
21 | 41 | |
|
22 | 42 | |
|
23 | 43 | Previously used `./rcstack init` command will setup docker, and bootstrap the env, but we still need to fetch dev-tools |
|
24 | 44 | |
|
25 | 45 | .. code-block:: bash |
|
26 | 46 | |
|
27 | 47 | # make sure we got the latest dev-tools installed |
|
28 | 48 | curl -L -s -o dev-tools https://code.rhodecode.com/rhodecode-enterprise-docker/raw/master/scripts/dev-tools/dev-tools && chmod +x dev-tools |
|
29 | 49 | |
|
30 | 50 | # Please check available options using --help |
|
31 | 51 | ./dev-tools --help |
|
32 | 52 | |
|
33 | 53 | |
|
34 | 54 | |
|
35 | 55 | Obtain source code |
|
36 | 56 | ++++++++++++++++++ |
|
37 | 57 | |
|
38 | Please clone the following repositories at the same level as :file:`rhodecode-docker` dir is created | |
|
39 | 58 | |
|
40 | .. code-block:: bash | |
|
59 | Please clone the following repositories into the WORKSPACE_HOME directory | |
|
41 | 60 | |
|
42 | hg clone https://code.rhodecode.com/internal/rhodecode-vcsserver | |
|
43 | hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ce | |
|
44 | hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ee | |
|
61 | For CE development: | |
|
45 | 62 | |
|
63 | .. code-block:: bash | |
|
46 | 64 | |
|
47 | Setup env variable WORKSPACE_HOME to your absolute path where you repositories for dev are stored. e.g | |
|
48 | ||
|
49 | example: | |
|
65 | hg clone https://code.rhodecode.com/rhodecode-vcsserver | |
|
66 | hg clone https://code.rhodecode.com/rhodecode-enterprise-ce | |
|
67 | # make a dummy repo without source code | |
|
68 | mkdir rhodecode-enterprise-ee | |
|
50 | 69 |
|
|
51 | `WORKSPACE_HOME=/media/psf/Home/workspace` | |
|
52 | 70 |
|
|
53 | Set this on bash: | |
|
71 | for EE development: | |
|
54 | 72 | |
|
55 | 73 | .. code-block:: bash |
|
56 | 74 | |
|
57 | export WORKSPACE_HOME=/media/psf/Home/workspace | |
|
75 | hg clone https://code.rhodecode.com/internal/rhodecode-vcsserver | |
|
76 | hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ce | |
|
77 | hg clone https://code.rhodecode.com/internal/rhodecode-enterprise-ee | |
|
58 | 78 | |
|
59 | 79 | |
|
60 | 80 | Finally this is the structure you should get: |
|
61 | 81 | |
|
62 | 82 | .. code-block:: bash |
|
63 | 83 | |
|
64 | 84 | ls -la $WORKSPACE_HOME |
|
65 | 85 | drwxr-xr-x 1 docker docker 928 Dec 18 23:46 rhodecode-docker |
|
66 | 86 | drwxr-xr-x 1 docker docker 1504 Dec 18 23:46 rhodecode-enterprise-ce |
|
67 | 87 | drwxr-xr-x 1 docker docker 1280 Dec 18 23:46 rhodecode-enterprise-ee |
|
68 | 88 | drwxr-xr-x 1 docker docker 832 Dec 18 23:46 rhodecode-vcsserver |
|
69 | 89 | |
|
70 | 90 | |
|
71 | 91 | run dev-env |
|
72 | 92 | +++++++++++ |
|
73 | 93 | |
|
74 | 94 | First start with setting up a dev builds for dev images |
|
75 | 95 | |
|
76 | 96 | .. code-block:: bash |
|
77 | 97 | |
|
78 | 98 | # execute from cd $WORKSPACE_HOME/rhodecode-docker |
|
79 | 99 | ./rcstack cli set-runtime-image beta |
|
80 | 100 | |
|
81 | 101 | |
|
82 | 102 | To start developing we need few services to run, we can run this using `dev-env` |
|
83 | 103 | |
|
84 | 104 | |
|
85 | 105 | .. code-block:: bash |
|
86 | 106 | |
|
87 | 107 | # execute from cd $WORKSPACE_HOME/rhodecode-docker |
|
88 | 108 | ./dev-tools dev-env |
|
89 | 109 | |
|
90 | 110 | |
|
111 | .. note:: | |
|
112 | ||
|
113 | There's an option to run dev version of each of the service, e.g if ssh or svn should be tested it can be run like | |
|
114 | ./dev-tools ssh | |
|
115 | ./dev-tools svn | |
|
116 | ||
|
117 | ||
|
91 | 118 | You can check the status of services by running |
|
92 | 119 | |
|
93 | 120 | .. code-block:: bash |
|
94 | 121 | |
|
95 | 122 | # execute from cd $WORKSPACE_HOME/rhodecode-docker |
|
96 | 123 | ./rcstack status |
|
97 | 124 | |
|
98 | 125 | |
|
99 | 126 | Prepare services in develop mode |
|
100 | 127 | ++++++++++++++++++++++++++++++++ |
|
101 | 128 | |
|
102 | 129 | copy the runtime.env as our dev.env: |
|
103 | 130 | |
|
104 | 131 | .. code-block:: bash |
|
105 | 132 | |
|
106 | 133 | cp .custom/.runtime.env .custom/.dev.env |
|
107 | 134 | |
|
108 | 135 | |
|
109 | 136 | go to rhodecode-vcsserver and run |
|
110 | 137 | |
|
111 | 138 | .. code-block:: bash |
|
112 | 139 | |
|
113 | 140 | # execute from cd $WORKSPACE_HOME/rhodecode-vcsserver |
|
114 | 141 | mkdir -p .dev/ |
|
115 | 142 | echo "make sh" > .dev/dev-env.sh && chmod +x .dev/dev-env.sh |
|
116 | 143 | cp configs/development.ini .dev/dev.ini |
|
117 | 144 | |
|
118 | 145 | |
|
119 | 146 | go to rhodecode-enterprise-ce and run |
|
120 | 147 | |
|
121 | 148 | .. code-block:: bash |
|
122 | 149 | |
|
123 | 150 | # execute from cd $WORKSPACE_HOME/rhodecode-enterprise-ce |
|
124 | 151 | mkdir -p .dev/ |
|
125 | 152 | echo "make sh" > .dev/dev-env.sh && chmod +x .dev/dev-env.sh |
|
126 | 153 | cp configs/development.ini .dev/dev.ini |
|
127 | 154 | |
|
128 | 155 | |
|
129 | 156 | run services (preferably in two separate shells) |
|
130 | 157 | ++++++++++++++++++++++++++++++++++++++++++++++++ |
|
131 | 158 | |
|
132 | 159 | |
|
133 | 160 | .. code-block:: bash |
|
134 | 161 | |
|
135 | 162 | cd $WORKSPACE_HOME/rhodecode-docker |
|
136 | 163 | |
|
137 | 164 | # shell 1 |
|
138 | 165 | ./dev-tools ce |
|
139 | 166 | β rhodecode-enterprise-ce |
|
140 | 167 | |
|
141 | 168 | # shell 2 |
|
142 | 169 | ./dev-tools vcs |
|
143 | 170 | β rhodecode-vcsserver |
|
144 | 171 | |
|
145 | 172 | |
|
146 | 173 | |
|
147 | 174 | Init DB |
|
148 | 175 | +++++++ |
|
149 | 176 | |
|
150 | 177 | |
|
151 | 178 | .. code-block:: bash |
|
152 | 179 | |
|
153 | 180 | # run from enterprise shell |
|
154 | 181 | β rhodecode-enterprise-ce |
|
155 | 182 | |
|
156 | 183 | /usr/local/bin/rhodecode_bin/bin/rc-setup-app \ |
|
157 | 184 | /home/rhodecode/rhodecode-enterprise-ce/.dev/dev.ini \ |
|
158 | 185 | --force-yes \ |
|
159 | 186 | --skip-existing-db \ |
|
160 | 187 | --user=admin \ |
|
161 | 188 | --password=secret4 \ |
|
162 | 189 | --email=admin@example.com \ |
|
163 | 190 | --repos=/var/opt/rhodecode_repo_store |
|
164 | 191 | |
|
165 | 192 | |
|
166 | 193 | .. note:: |
|
167 | 194 | |
|
168 | 195 | --user=admin --password=secret4 used here can be used to log-in to first super-admin account in web UI |
|
169 | 196 | |
|
170 | 197 | |
|
171 | 198 | Manually Upgrade DB |
|
172 | 199 | +++++++++++++++++++ |
|
173 | 200 | |
|
174 | 201 | |
|
175 | 202 | .. code-block:: bash |
|
176 | 203 | |
|
177 | 204 | /usr/local/bin/rhodecode_bin/bin/rc-upgrade-db \ |
|
178 | 205 | /home/rhodecode/rhodecode-enterprise-ce/.dev/dev.ini \ |
|
179 | 206 | --force-yes |
General Comments 0
You need to be logged in to leave comments.
Login now