-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade.html
348 lines (314 loc) · 16.9 KB
/
upgrade.html
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<!DOCTYPE html>
<!--[if IE 8]>
<html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head><base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/theme.css" type="text/css" />
<link rel="stylesheet" href="assets/css/highlightjs.css" type="text/css" />
<link rel="stylesheet" href="assets/css/badge_only.css" type="text/css" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<div class="wy-nav-content"> <div class="rst-content">
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody">
<div class="section">
<h1 id="upgrade-hupkit">
Upgrade HuPKit
<a class="headerlink" href="#upgrade-hupkit" title="Permalink to this headline">¶</a>
</h1>
<div class="section">
<h2 id="upgrade-to-v1-4-0-beta1">
Upgrade to v1.4.0-BETA1
<a class="headerlink" href="#upgrade-to-v1-4-0-beta1" title="Permalink to this headline">¶</a>
</h2>
<p>Using global configuration for repositories is now deprecated and will be removed
in v2.0. Use repository local configuration instead.</p>
<p>Use the <code translate="no" class="notranslate">init-config</code> command for each repository to import the global configuration,
then manually remove the repository in the global configuration.</p>
</div>
<div class="section">
<h2 id="upgrade-to-v1-3-0-beta2">
Upgrade to v1.3.0-BETA2
<a class="headerlink" href="#upgrade-to-v1-3-0-beta2" title="Permalink to this headline">¶</a>
</h2>
<p>Storing the branch-alias in Git configuration is now deprecated and will be removed
in v2.0. Either add the <code translate="no" class="notranslate">extra.branch-alias.dev-main</code> in composer.json, or
add <code translate="no" class="notranslate">"branches_alias.main"</code> to the repository local configuration:</p>
<div translate="no" class="highlight-php notranslate">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>1
2
3
4
5
6
7
8</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre class="hljs php"><span class="hljs-keyword">return</span> [
<span class="hljs-comment">// ...</span>
<span class="hljs-string">'branches_alias'</span> => [
<span class="hljs-string">'main'</span> => <span class="hljs-string">'1.0'</span>,
],
];</pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<h2 id="upgrade-to-v1-2-0-beta6">
Upgrade to v1.2.0-BETA6
<a class="headerlink" href="#upgrade-to-v1-2-0-beta6" title="Permalink to this headline">¶</a>
</h2>
<p>The pre/post release hook scripts are now expected to be stored in the
<code translate="no" class="notranslate">_hubkit</code> configuration branch.</p>
<p><em>Using the ".hubkit" directory at the root of the repository is still supported,
but will no longer work in HuPKit v2.0.</em></p>
<div class="admonition admonition-caution ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
<span>Caution</span>
</p><p>Hooks are loaded from a temporary location <em>outside of the repository</em>,
use the <code translate="no" class="notranslate">__DIR__</code> constant to load files from the the temp-location,
use <code translate="no" class="notranslate">$container['current_dir']</code> to get the actual location to the
project repository.</p>
</div>
<p>The services already use the correct current location (the repository root).</p>
<p><strong>For example:</strong></p>
<div translate="no" class="highlight-php notranslate">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>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</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre class="hljs php"><span class="hljs-meta"><?php</span>
<span class="hljs-comment">// pre-release.php (in the "_hubkit" branch)</span>
<span class="hljs-keyword">declare</span>(strict_types=<span class="hljs-number">1</span>);
<span class="hljs-keyword">use</span> <span class="hljs-title">Psr</span>\<span class="hljs-title">Container</span>\<span class="hljs-title">ContainerInterface</span> <span class="hljs-title">as</span> <span class="hljs-title">Container</span>;
<span class="hljs-keyword">use</span> <span class="hljs-title">Rollerworks</span>\<span class="hljs-title">Component</span>\<span class="hljs-title">Version</span>\<span class="hljs-title">Version</span>;
<span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(Container <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span>, Version <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>version</span>, string <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>branch</span>, ?string <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>releaseTitle</span>, string <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>changelog</span>)</span> </span>{
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span><span class="hljs-operator">-></span>get(<span class="hljs-string">'logger'</span>)<span class="hljs-operator">-></span>debug(<span class="hljs-string">'Working at: '</span> . <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span>[<span class="hljs-string">'current_dir'</span>]);
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span><span class="hljs-operator">-></span>get(<span class="hljs-string">'logger'</span>)<span class="hljs-operator">-></span>info(<span class="hljs-string">'Updating composer branch-alias'</span>);
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span><span class="hljs-operator">-></span>get(<span class="hljs-string">'process'</span>)<span class="hljs-operator">-></span>mustRun([<span class="hljs-string">'composer'</span>, <span class="hljs-string">'config'</span>, <span class="hljs-string">'extra.branch-alias.dev-'</span>.<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>branch</span>, sprintf(<span class="hljs-string">'%d.%d-dev'</span>, <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>version</span><span class="hljs-operator">-></span>major, <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>version</span><span class="hljs-operator">-></span>minor)]);
<span class="hljs-comment">/** <span class="hljs-doctag">@var</span> \HubKit\Service\Git\GitBranch $gitBranch */</span>
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>gitBranch</span> = <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span><span class="hljs-operator">-></span>get(<span class="hljs-string">'git.branch'</span>);
<span class="hljs-keyword">if</span> (<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>gitBranch</span><span class="hljs-operator">-></span>isWorkingTreeReady()) {
<span class="hljs-keyword">return</span>; <span class="hljs-comment">// Nothing to, composer is already up-to-date</span>
}
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>gitBranch</span><span class="hljs-operator">-></span>add(<span class="hljs-string">'composer.json'</span>);
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>gitBranch</span><span class="hljs-operator">-></span>commit(<span class="hljs-string">'Update composer branch-alias'</span>);
<span class="hljs-comment">/** <span class="hljs-doctag">@var</span> \HubKit\Service\Git $git */</span>
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>git</span> = <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>container</span><span class="hljs-operator">-></span>get(<span class="hljs-string">'git.branch'</span>);
<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>git</span><span class="hljs-operator">-></span>pushToRemote(<span class="hljs-string">'upstream'</span>, <span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>branch</span>);
};</pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<h2 id="upgrade-to-v1-2-0-beta4">
Upgrade to v1.2.0-BETA4
<a class="headerlink" href="#upgrade-to-v1-2-0-beta4" title="Permalink to this headline">¶</a>
</h2>
<p>The configuration format was changed to allow for more advanced features,
change the <code translate="no" class="notranslate">schema_version</code> to 2 and upgrade to the new structure.</p>
<div class="admonition admonition-note ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
<span>Note</span>
</p><p>The old configuration format still works (until the next major release of HuPKit) but will give a warning.</p>
</div>
<p>For config.php the new structure is as follows, see the <a href="config.html" class="reference internal">Configuration</a> chapter
for all options.</p>
<div translate="no" class="highlight-diff notranslate">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>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</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre class="hljs diff"><span class="hljs-deletion">- 'schema_version' => 1,</span>
<span class="hljs-addition">+ 'schema_version' => 2,</span>
<span class="hljs-deletion">-// 'repos' => [</span>
<span class="hljs-deletion">-// 'github.com' => [</span>
<span class="hljs-deletion">-// 'park-manager/park-manager' => [</span>
<span class="hljs-deletion">-// 'sync-tags' => true,</span>
<span class="hljs-deletion">-// 'split' => [</span>
<span class="hljs-deletion">-// 'src/Bundle/CoreBundle' => 'git@github.com:park-manager/core-bundle.git',</span>
<span class="hljs-deletion">-// 'src/Bundle/UserBundle' => 'git@github.com:park-manager/user-bundle.git',</span>
<span class="hljs-deletion">-// 'doc' => ['git@github.com:park-manager/doc.git', 'sync-tags' => false],</span>
<span class="hljs-deletion">-// ],</span>
<span class="hljs-deletion">-// ],</span>
<span class="hljs-deletion">-// ],</span>
<span class="hljs-deletion">-// ],</span>
<span class="hljs-addition">+</span>
<span class="hljs-addition">+ 'repositories' => [</span>
<span class="hljs-addition">+ 'github.com' => [</span>
<span class="hljs-addition">+ 'park-manager/park-manager' => [</span>
<span class="hljs-addition">+ 'branches' => [</span>
<span class="hljs-addition">+ ':default' => [</span>
<span class="hljs-addition">+ 'sync-tags' => true,</span>
<span class="hljs-addition">+ 'split' => [</span>
<span class="hljs-addition">+ 'src/Module/CoreModule' => 'git@github.com:hubkit-sandbox/core-module.git',</span>
<span class="hljs-addition">+ 'src/Module/WebhostingModule' => 'git@github.com:hubkit-sandbox/webhosting-module.git',</span>
<span class="hljs-addition">+ 'docs' => ['url' => 'git@github.com:park-manager/doc.git', 'sync-tags' => false],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ '1.0' => false, // Disabled</span>
<span class="hljs-addition">+ '2.x' => [</span>
<span class="hljs-addition">+ 'upmerge' => false,</span>
<span class="hljs-addition">+ // Split's is inherited and merged from ':default'</span>
<span class="hljs-addition">+ 'split' => [</span>
<span class="hljs-addition">+ 'src/Module/DomainRegModule' => 'git@github.com:hubkit-sandbox/webhosting-module.git',</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ '3.x' => [</span>
<span class="hljs-addition">+ 'sync-tags' => null, // Inherit from the root configuration.</span>
<span class="hljs-addition">+ 'split' => [</span>
<span class="hljs-addition">+ 'src/Module/WebhostingModule' => false,</span>
<span class="hljs-addition">+ 'src/Module/DomainRegModule' => 'git@github.com:hubkit-sandbox/webhosting-module.git',</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ '4.1' => [</span>
<span class="hljs-addition">+ 'ignore-default' => true, // Nothing is inherited from ':default'</span>
<span class="hljs-addition">+ 'sync-tags' => false,</span>
<span class="hljs-addition">+ 'src/Bundle/CoreBundle' => 'git@github.com:hubkit-sandbox/core-module.git',</span>
<span class="hljs-addition">+ 'src/Bundle/WebhostingBundle' => 'git@github.com:hubkit-sandbox/webhosting-module.git',</span>
<span class="hljs-addition">+ 'docs' => ['url' => 'git@github.com:park-manager/doc.git', 'sync-tags' => false],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span>
<span class="hljs-addition">+ ],</span></pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
</div> </div>
</section>
</div>
<script type="text/javascript" src="assets/js/theme.js"></script>
<script type="text/javascript" src="assets/js/badge_only.js"></script>
</body>
</html>