@rancher/shell 0.3.28 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/assets/translations/en-us.yaml +16 -2
- package/assets/translations/zh-hans.yaml +1 -1
- package/chart/monitoring/grafana/index.vue +2 -2
- package/components/AsyncButton.vue +9 -0
- package/components/CopyCode.vue +6 -2
- package/components/CopyToClipboard.vue +2 -1
- package/components/CopyToClipboardText.vue +14 -9
- package/components/EtcdInfoBanner.vue +4 -4
- package/components/Markdown.vue +16 -12
- package/components/ResourceDetail/Masthead.vue +9 -6
- package/components/SortableTable/THead.vue +7 -9
- package/components/SortableTable/index.vue +1 -2
- package/components/StatusTable.vue +5 -1
- package/components/__tests__/CopyCode.test.ts +5 -4
- package/components/fleet/FleetBundles.vue +5 -11
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +35 -30
- package/components/fleet/__tests__/FleetSummary.test.ts +316 -0
- package/components/form/Password.vue +3 -1
- package/components/nav/Header.vue +1 -1
- package/config/home-links.js +1 -1
- package/core/plugin-helpers.js +3 -5
- package/creators/app/files/.gitlab-ci.yml +14 -0
- package/creators/app/init +19 -0
- package/detail/provisioning.cattle.io.cluster.vue +2 -1
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +12 -3
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +2 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +3 -1
- package/edit/workload/Upgrading.vue +3 -2
- package/edit/workload/index.vue +2 -1
- package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -1
- package/initialize/index.js +24 -5
- package/machine-config/__tests__/vmwarevsphere.test.ts +72 -0
- package/machine-config/vmwarevsphere.vue +68 -13
- package/models/__tests__/management.cattle.io.cluster.test.ts +4 -0
- package/models/management.cattle.io.cluster.js +7 -3
- package/models/provisioning.cattle.io.cluster.js +19 -1
- package/package.json +3 -2
- package/pages/c/_cluster/apps/charts/index.vue +64 -43
- package/plugins/clean-html-directive.js +1 -19
- package/plugins/clean-html.js +53 -0
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/index.js +11 -0
- package/rancher-components/BadgeState/BadgeState.vue +5 -1
- package/rancher-components/Banner/Banner.test.ts +51 -1
- package/rancher-components/Banner/Banner.vue +134 -53
- package/rancher-components/Card/Card.test.ts +37 -0
- package/rancher-components/Card/Card.vue +24 -7
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +20 -29
- package/rancher-components/Form/Checkbox/Checkbox.vue +45 -20
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +2 -8
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +22 -10
- package/rancher-components/Form/Radio/RadioButton.test.ts +31 -0
- package/rancher-components/Form/Radio/RadioButton.vue +30 -13
- package/rancher-components/Form/Radio/RadioGroup.vue +26 -7
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -6
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +25 -38
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +23 -11
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +19 -5
- package/rancher-components/StringList/StringList.test.ts +453 -49
- package/rancher-components/StringList/StringList.vue +92 -58
- package/scripts/.DS_Store +0 -0
- package/scripts/extension/bundle +19 -7
- package/scripts/extension/helm/scripts/package +11 -3
- package/scripts/extension/publish +20 -9
- package/scripts/verdaccio.log +205 -0
- package/store/index.js +3 -4
- package/types/shell/index.d.ts +15 -9
- package/utils/clipboard.js +5 -0
- package/yarn-error.log +200 -0
- package/plugins/vue-clipboard2.js +0 -4
|
@@ -30,9 +30,9 @@ const CLASS = {
|
|
|
30
30
|
* Manage a list of strings
|
|
31
31
|
*/
|
|
32
32
|
export default Vue.extend({
|
|
33
|
-
components: { LabeledInput },
|
|
34
33
|
|
|
35
|
-
name:
|
|
34
|
+
name: 'StringList',
|
|
35
|
+
components: { LabeledInput },
|
|
36
36
|
|
|
37
37
|
props: {
|
|
38
38
|
/**
|
|
@@ -85,11 +85,11 @@ export default Vue.extend({
|
|
|
85
85
|
},
|
|
86
86
|
data() {
|
|
87
87
|
return {
|
|
88
|
-
value:
|
|
89
|
-
selected:
|
|
90
|
-
|
|
91
|
-
isCreateItem:
|
|
92
|
-
errors:
|
|
88
|
+
value: null as string | null,
|
|
89
|
+
selected: null as string | null,
|
|
90
|
+
editedItem: null as string | null,
|
|
91
|
+
isCreateItem: false,
|
|
92
|
+
errors: { duplicate: false } as Record<Error, boolean>
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
95
|
|
|
@@ -100,8 +100,8 @@ export default Vue.extend({
|
|
|
100
100
|
*/
|
|
101
101
|
errorMessagesArray(): string[] {
|
|
102
102
|
return (Object.keys(this.errors) as Error[])
|
|
103
|
-
.filter(f =>
|
|
104
|
-
.map(k => this.errorMessages[k]);
|
|
103
|
+
.filter((f) => this.errors[f] && this.errorMessages[f])
|
|
104
|
+
.map((k) => this.errorMessages[k]);
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
|
|
@@ -113,23 +113,35 @@ export default Vue.extend({
|
|
|
113
113
|
this.toggleEditMode(false);
|
|
114
114
|
this.toggleCreateMode(false);
|
|
115
115
|
},
|
|
116
|
+
value(val) {
|
|
117
|
+
this.$emit('type:item', val);
|
|
118
|
+
},
|
|
119
|
+
errors: {
|
|
120
|
+
handler(val) {
|
|
121
|
+
this.$emit('errors', val);
|
|
122
|
+
},
|
|
123
|
+
deep: true
|
|
124
|
+
}
|
|
116
125
|
},
|
|
117
126
|
|
|
118
127
|
methods: {
|
|
119
128
|
onChange(value: string) {
|
|
120
129
|
this.value = value;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
|
|
131
|
+
const items = [
|
|
132
|
+
...this.items,
|
|
133
|
+
this.value
|
|
134
|
+
];
|
|
135
|
+
|
|
124
136
|
this.toggleError(
|
|
125
137
|
'duplicate',
|
|
126
|
-
|
|
127
|
-
this.isCreateItem ? INPUT.create : INPUT.edit
|
|
138
|
+
hasDuplicatedStrings(items, this.caseSensitive),
|
|
139
|
+
this.isCreateItem ? INPUT.create : INPUT.edit
|
|
128
140
|
);
|
|
129
141
|
},
|
|
130
142
|
|
|
131
143
|
onSelect(item: string) {
|
|
132
|
-
if (this.isCreateItem || this.
|
|
144
|
+
if (this.readonly || this.isCreateItem || this.editedItem === item) {
|
|
133
145
|
return;
|
|
134
146
|
}
|
|
135
147
|
this.selected = item;
|
|
@@ -160,7 +172,7 @@ export default Vue.extend({
|
|
|
160
172
|
},
|
|
161
173
|
|
|
162
174
|
onClickEmptyBody() {
|
|
163
|
-
if (!this.isCreateItem && !this.
|
|
175
|
+
if (!this.isCreateItem && !this.editedItem) {
|
|
164
176
|
this.toggleCreateMode(true);
|
|
165
177
|
}
|
|
166
178
|
},
|
|
@@ -176,38 +188,43 @@ export default Vue.extend({
|
|
|
176
188
|
|
|
177
189
|
return;
|
|
178
190
|
}
|
|
179
|
-
if (this.
|
|
191
|
+
if (this.editedItem) {
|
|
192
|
+
this.deleteAndSelectNext(this.editedItem);
|
|
180
193
|
this.toggleEditMode(false);
|
|
181
194
|
|
|
182
195
|
return;
|
|
183
196
|
}
|
|
184
197
|
if (this.selected) {
|
|
185
|
-
|
|
198
|
+
this.deleteAndSelectNext(this.selected);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
186
201
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
202
|
+
deleteAndSelectNext(currItem: string) {
|
|
203
|
+
const index = findStringIndex(this.items, currItem, false);
|
|
204
|
+
|
|
205
|
+
if (index !== -1) {
|
|
206
|
+
/**
|
|
207
|
+
* Select the next item in the list.
|
|
208
|
+
*/
|
|
209
|
+
const item = (this.items[index + 1] || this.items[index - 1]);
|
|
192
210
|
|
|
193
|
-
|
|
194
|
-
|
|
211
|
+
this.onSelect(item);
|
|
212
|
+
this.setFocus(item);
|
|
195
213
|
|
|
196
|
-
|
|
197
|
-
}
|
|
214
|
+
this.deleteItem(this.items[index]);
|
|
198
215
|
}
|
|
199
216
|
},
|
|
200
217
|
|
|
201
218
|
setFocus(refId: string) {
|
|
202
|
-
this.$nextTick(() => this.getElemByRef(refId)?.focus());
|
|
219
|
+
this.$nextTick(() => (this.getElemByRef(refId) as Vue & HTMLElement)?.focus());
|
|
203
220
|
},
|
|
204
221
|
|
|
205
222
|
/**
|
|
206
223
|
* Move scrollbar when the selected item is over the top or bottom side of the box
|
|
207
224
|
*/
|
|
208
225
|
moveScrollbar(arrow: Arrow, value?: number) {
|
|
209
|
-
const box = this.getElemByRef(BOX);
|
|
210
|
-
const item = this.getElemByRef(this.selected || '');
|
|
226
|
+
const box = this.getElemByRef(BOX) as HTMLElement;
|
|
227
|
+
const item = this.getElemByRef(this.selected || '') as HTMLElement;
|
|
211
228
|
|
|
212
229
|
if (box && item && item.className.includes(CLASS.item)) {
|
|
213
230
|
const boxRect = box.getClientRects()[0];
|
|
@@ -229,13 +246,14 @@ export default Vue.extend({
|
|
|
229
246
|
*/
|
|
230
247
|
toggleError(type: Error, val: boolean, refId?: string) {
|
|
231
248
|
this.errors[type] = val;
|
|
249
|
+
|
|
232
250
|
if (refId) {
|
|
233
251
|
this.toggleErrorClass(refId, val);
|
|
234
252
|
}
|
|
235
253
|
},
|
|
236
254
|
|
|
237
255
|
toggleErrorClass(refId: string, val: boolean) {
|
|
238
|
-
const input = this.getElemByRef(refId)?.$el;
|
|
256
|
+
const input = (this.getElemByRef(refId) as Vue)?.$el;
|
|
239
257
|
|
|
240
258
|
if (input) {
|
|
241
259
|
if (val) {
|
|
@@ -250,7 +268,11 @@ export default Vue.extend({
|
|
|
250
268
|
* Show/Hide the input line to create new item
|
|
251
269
|
*/
|
|
252
270
|
toggleCreateMode(show: boolean) {
|
|
271
|
+
if (this.readonly) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
253
274
|
if (show) {
|
|
275
|
+
this.toggleEditMode(false);
|
|
254
276
|
this.value = '';
|
|
255
277
|
|
|
256
278
|
this.isCreateItem = true;
|
|
@@ -268,31 +290,34 @@ export default Vue.extend({
|
|
|
268
290
|
* Show/Hide the in-line editing to edit an existing item
|
|
269
291
|
*/
|
|
270
292
|
toggleEditMode(show: boolean, item?: string) {
|
|
293
|
+
if (this.readonly) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
271
296
|
if (show) {
|
|
272
297
|
this.toggleCreateMode(false);
|
|
273
|
-
this.value = this.
|
|
298
|
+
this.value = this.editedItem;
|
|
274
299
|
|
|
275
|
-
this.
|
|
300
|
+
this.editedItem = item || '';
|
|
276
301
|
this.setFocus(INPUT.edit);
|
|
277
302
|
} else {
|
|
278
303
|
this.value = null;
|
|
279
304
|
this.toggleError('duplicate', false);
|
|
280
305
|
this.onSelectLeave();
|
|
281
306
|
|
|
282
|
-
this.
|
|
307
|
+
this.editedItem = null;
|
|
283
308
|
}
|
|
284
309
|
},
|
|
285
310
|
|
|
286
311
|
getElemByRef(id: string) {
|
|
287
312
|
const ref = this.$refs[id];
|
|
288
313
|
|
|
289
|
-
return
|
|
314
|
+
return Array.isArray(ref) ? ref[0] : ref;
|
|
290
315
|
},
|
|
291
316
|
|
|
292
317
|
/**
|
|
293
318
|
* Create a new item and insert in the items list
|
|
294
319
|
*/
|
|
295
|
-
saveItem() {
|
|
320
|
+
saveItem(closeInput = true) {
|
|
296
321
|
const value = this.value?.trim();
|
|
297
322
|
|
|
298
323
|
if (value) {
|
|
@@ -301,21 +326,20 @@ export default Vue.extend({
|
|
|
301
326
|
value,
|
|
302
327
|
];
|
|
303
328
|
|
|
304
|
-
if (hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
305
|
-
this.
|
|
306
|
-
|
|
307
|
-
return;
|
|
329
|
+
if (!hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
330
|
+
this.updateItems(items);
|
|
308
331
|
}
|
|
332
|
+
}
|
|
309
333
|
|
|
310
|
-
|
|
334
|
+
if (closeInput) {
|
|
335
|
+
this.toggleCreateMode(false);
|
|
311
336
|
}
|
|
312
|
-
this.toggleCreateMode(false);
|
|
313
337
|
},
|
|
314
338
|
|
|
315
339
|
/**
|
|
316
340
|
* Update an existing item in the items list
|
|
317
341
|
*/
|
|
318
|
-
updateItem(item: string) {
|
|
342
|
+
updateItem(item: string, closeInput = true) {
|
|
319
343
|
const value = this.value?.trim();
|
|
320
344
|
|
|
321
345
|
if (value) {
|
|
@@ -326,22 +350,21 @@ export default Vue.extend({
|
|
|
326
350
|
items[index] = value;
|
|
327
351
|
}
|
|
328
352
|
|
|
329
|
-
if (hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
330
|
-
this.
|
|
331
|
-
|
|
332
|
-
return;
|
|
353
|
+
if (!hasDuplicatedStrings(items, this.caseSensitive)) {
|
|
354
|
+
this.updateItems(items);
|
|
333
355
|
}
|
|
356
|
+
}
|
|
334
357
|
|
|
335
|
-
|
|
358
|
+
if (closeInput) {
|
|
359
|
+
this.toggleEditMode(false);
|
|
336
360
|
}
|
|
337
|
-
this.toggleEditMode(false);
|
|
338
361
|
},
|
|
339
362
|
|
|
340
363
|
/**
|
|
341
364
|
* Remove an item from items list
|
|
342
365
|
*/
|
|
343
366
|
deleteItem(item?: string) {
|
|
344
|
-
const items = this.items.filter(f => f !== item);
|
|
367
|
+
const items = this.items.filter((f) => f !== item);
|
|
345
368
|
|
|
346
369
|
this.updateItems(items);
|
|
347
370
|
},
|
|
@@ -387,19 +410,20 @@ export default Vue.extend({
|
|
|
387
410
|
@blur="onSelectLeave(item)"
|
|
388
411
|
>
|
|
389
412
|
<span
|
|
390
|
-
v-if="!
|
|
413
|
+
v-if="!editedItem || editedItem !== item"
|
|
391
414
|
class="label static"
|
|
392
415
|
>
|
|
393
416
|
{{ item }}
|
|
394
417
|
</span>
|
|
395
418
|
<LabeledInput
|
|
396
|
-
v-if="
|
|
419
|
+
v-if="editedItem && editedItem === item"
|
|
397
420
|
ref="item-edit"
|
|
421
|
+
:data-testid="`item-edit-${item}`"
|
|
398
422
|
class="edit-input static"
|
|
399
423
|
:value="value != null ? value : item"
|
|
400
424
|
@input="onChange($event)"
|
|
401
|
-
@blur.prevent="
|
|
402
|
-
@keydown.native.enter="updateItem(item)"
|
|
425
|
+
@blur.prevent="updateItem(item)"
|
|
426
|
+
@keydown.native.enter="updateItem(item, !errors.duplicate)"
|
|
403
427
|
/>
|
|
404
428
|
</div>
|
|
405
429
|
<div
|
|
@@ -408,12 +432,14 @@ export default Vue.extend({
|
|
|
408
432
|
>
|
|
409
433
|
<LabeledInput
|
|
410
434
|
ref="item-create"
|
|
435
|
+
data-testid="item-create"
|
|
411
436
|
class="create-input static"
|
|
412
437
|
type="text"
|
|
413
438
|
:value="value"
|
|
414
439
|
:placeholder="placeholder"
|
|
415
440
|
@input="onChange($event)"
|
|
416
|
-
@
|
|
441
|
+
@blur.prevent="saveItem"
|
|
442
|
+
@keydown.native.enter="saveItem(!errors.duplicate)"
|
|
417
443
|
/>
|
|
418
444
|
</div>
|
|
419
445
|
</div>
|
|
@@ -427,25 +453,32 @@ export default Vue.extend({
|
|
|
427
453
|
class="action-buttons"
|
|
428
454
|
>
|
|
429
455
|
<button
|
|
456
|
+
data-testid="button-remove"
|
|
430
457
|
class="btn btn-sm role-tertiary remove-button"
|
|
431
|
-
:disabled="!selected && !isCreateItem && !
|
|
458
|
+
:disabled="!selected && !isCreateItem && !editedItem"
|
|
432
459
|
@mousedown.prevent="onClickMinusButton"
|
|
433
460
|
>
|
|
434
461
|
<span class="icon icon-minus icon-sm" />
|
|
435
462
|
</button>
|
|
436
463
|
<button
|
|
464
|
+
data-testid="button-add"
|
|
437
465
|
class="btn btn-sm role-tertiary add-button"
|
|
438
|
-
:disabled="isCreateItem"
|
|
466
|
+
:disabled="isCreateItem || editedItem"
|
|
439
467
|
@click.prevent="onClickPlusButton"
|
|
440
468
|
>
|
|
441
469
|
<span class="icon icon-plus icon-sm" />
|
|
442
470
|
</button>
|
|
443
471
|
</div>
|
|
444
472
|
<div class="messages">
|
|
445
|
-
<i
|
|
473
|
+
<i
|
|
474
|
+
v-if="errorMessagesArray.length > 0"
|
|
475
|
+
data-testid="i-warning-icon"
|
|
476
|
+
class="icon icon-warning icon-lg"
|
|
477
|
+
/>
|
|
446
478
|
<span
|
|
447
479
|
v-for="(msg, idx) in errorMessagesArray"
|
|
448
480
|
:key="idx"
|
|
481
|
+
:data-testid="`span-error-message-${msg}`"
|
|
449
482
|
class="error"
|
|
450
483
|
>
|
|
451
484
|
{{ idx > 0 ? '; ' : '' }}
|
|
@@ -499,6 +532,7 @@ export default Vue.extend({
|
|
|
499
532
|
width: auto;
|
|
500
533
|
user-select: none;
|
|
501
534
|
overflow: hidden;
|
|
535
|
+
white-space: no-wrap;
|
|
502
536
|
text-overflow: ellipsis;
|
|
503
537
|
padding-top: 1px;
|
|
504
538
|
}
|
|
Binary file
|
package/scripts/extension/bundle
CHANGED
|
@@ -16,6 +16,7 @@ REGISTRY="${3}"
|
|
|
16
16
|
REGISTRY_ORG="${4}"
|
|
17
17
|
IMAGE_PREFIX="${5}"
|
|
18
18
|
PUSH="${6}"
|
|
19
|
+
PODMAN_CONTAINER="${7}"
|
|
19
20
|
|
|
20
21
|
PKG_NAME="${PKG}-${PKG_VERSION}"
|
|
21
22
|
|
|
@@ -48,12 +49,15 @@ for d in ${BASE_DIR}/dist-pkg/*; do
|
|
|
48
49
|
cp -R ${BASE_DIR}/dist-pkg/${pkg} ${TMP}/container/plugin
|
|
49
50
|
done
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
package() {
|
|
53
|
+
if [ "${PODMAN_CONTAINER}" == "true" ]; then
|
|
54
|
+
RUNTIME="podman"
|
|
55
|
+
else
|
|
56
|
+
RUNTIME="docker"
|
|
57
|
+
fi
|
|
58
|
+
echo -e "Container build: ${RUNTIME}"
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
REGISTRY=${REGISTRY} ORG=${REGISTRY_ORG} REPO=${IMAGE_PREFIX}${PKG} TAG=${PKG_VERSION} ./scripts/package
|
|
60
|
+
REGISTRY=${REGISTRY} ORG=${REGISTRY_ORG} REPO=${IMAGE_PREFIX}${PKG} TAG=${PKG_VERSION} RUNTIME=${RUNTIME} ./scripts/package
|
|
57
61
|
|
|
58
62
|
if [ "${PUSH}" == "--push" ]; then
|
|
59
63
|
echo -e "${CYAN}Pushing container image ...${RESET}"
|
|
@@ -61,14 +65,22 @@ if [ ! -z "${REGISTRY}" ]; then
|
|
|
61
65
|
# Ensure that you do not overwrite production images
|
|
62
66
|
if [[ "${REGISTRY_ORG}" == "rancher" ]]; then
|
|
63
67
|
IMAGE=${REGISTRY}${REGISTRY_ORG}/${IMAGE_PREFIX}${PKG}:${PKG_VERSION}
|
|
64
|
-
if
|
|
68
|
+
if ${RUNTIME} manifest inspect ${IMAGE} 2>&1 1>/dev/null; then
|
|
65
69
|
echo -e "${RED}${BOLD}Cannot overwrite production image ${IMAGE_PREFIX}${PKG} since it already exists${RESET}"
|
|
66
70
|
exit 1
|
|
67
71
|
fi
|
|
68
72
|
fi
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
${RUNTIME} push ${REGISTRY}${REGISTRY_ORG}/${IMAGE_PREFIX}${PKG}:${PKG_VERSION}
|
|
71
75
|
fi
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
# Build the container image
|
|
79
|
+
pushd ${TMP}/container > /dev/null
|
|
80
|
+
echo -e "${CYAN}Building container image ...${RESET}"
|
|
81
|
+
|
|
82
|
+
if [ ! -z "${REGISTRY}" ]; then
|
|
83
|
+
package
|
|
72
84
|
fi
|
|
73
85
|
|
|
74
86
|
popd > /dev/null
|
|
@@ -5,8 +5,8 @@ source $(dirname $0)/version
|
|
|
5
5
|
|
|
6
6
|
cd $(dirname $0)/..
|
|
7
7
|
|
|
8
|
-
if [[ -z ${ORG} ]] || [[ -z ${REPO} ]] || [[ -z ${TAG} ]]; then
|
|
9
|
-
echo "Usage: [REGISTRY=] ORG= REPO= TAG= ./scripts/package"
|
|
8
|
+
if [[ -z ${ORG} ]] || [[ -z ${REPO} ]] || [[ -z ${TAG} ]] || [[ -z ${RUNTIME} ]]; then
|
|
9
|
+
echo "Usage: [REGISTRY=] ORG= REPO= TAG= RUNTIME= ./scripts/package"
|
|
10
10
|
exit 1
|
|
11
11
|
fi
|
|
12
12
|
|
|
@@ -19,5 +19,13 @@ if [ -e ${DOCKERFILE}.${ARCH} ]; then
|
|
|
19
19
|
DOCKERFILE=${DOCKERFILE}.${ARCH}
|
|
20
20
|
fi
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
BUILD="${RUNTIME} build -f ${DOCKERFILE} -t ${IMAGE}"
|
|
23
|
+
|
|
24
|
+
if [[ ${RUNTIME} == "podman" ]]; then
|
|
25
|
+
BUILD="$BUILD -v /var/lib/containers:/var/lib/containers ."
|
|
26
|
+
else
|
|
27
|
+
BUILD="$BUILD ."
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
$BUILD
|
|
23
31
|
echo Built ${IMAGE}
|
|
@@ -17,6 +17,7 @@ IMAGE_PREFIX="ui-extension-"
|
|
|
17
17
|
FORCE="false"
|
|
18
18
|
GITHUB_BUILD="true"
|
|
19
19
|
GITHUB_RELEASE_TAG=""
|
|
20
|
+
PODMAN_CONTAINER="false"
|
|
20
21
|
|
|
21
22
|
GITHUB_SOURCE=$(git config --get remote.origin.url | sed -e 's/^git@.*:\([[:graph:]]*\).git/\1/')
|
|
22
23
|
GITHUB_BRANCH="main"
|
|
@@ -33,10 +34,11 @@ usage() {
|
|
|
33
34
|
echo " -r <name> Specify destination container registry for built images"
|
|
34
35
|
echo " -o <name> Specify destination container registry organization for built images"
|
|
35
36
|
echo " -i <prefix> Specify prefix for the built container image (default: 'ui-extension-')"
|
|
37
|
+
echo " -l Specify Podman container build"
|
|
36
38
|
exit 1
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
while getopts "hvr:o:pi:fcb:t:s:" opt; do
|
|
41
|
+
while getopts "hvr:o:pi:fcb:t:s:l" opt; do
|
|
40
42
|
case $opt in
|
|
41
43
|
h)
|
|
42
44
|
usage
|
|
@@ -70,6 +72,9 @@ while getopts "hvr:o:pi:fcb:t:s:" opt; do
|
|
|
70
72
|
t)
|
|
71
73
|
GITHUB_RELEASE_TAG="${OPTARG}"
|
|
72
74
|
;;
|
|
75
|
+
l)
|
|
76
|
+
PODMAN_CONTAINER="true"
|
|
77
|
+
;;
|
|
73
78
|
*)
|
|
74
79
|
usage
|
|
75
80
|
;;
|
|
@@ -126,7 +131,11 @@ fi
|
|
|
126
131
|
|
|
127
132
|
COMMANDS=("node" "jq" "yq" "git" "helm" "yarn")
|
|
128
133
|
if [ "${GITHUB_BUILD}" == "false" ]; then
|
|
129
|
-
|
|
134
|
+
if [ "${PODMAN_CONTAINER}" == "true" ]; then
|
|
135
|
+
COMMANDS+=("podman")
|
|
136
|
+
else
|
|
137
|
+
COMMANDS+=("docker")
|
|
138
|
+
fi
|
|
130
139
|
fi
|
|
131
140
|
|
|
132
141
|
HAVE_COMMANDS="true"
|
|
@@ -172,10 +181,12 @@ if [ "${GITHUB_BUILD}" == "false" ]; then
|
|
|
172
181
|
exit 1
|
|
173
182
|
fi
|
|
174
183
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
if [ "${PODMAN_CONTAINER}" == "false" ]; then
|
|
185
|
+
docker images > /dev/null
|
|
186
|
+
if [ $? -ne 0 ]; then
|
|
187
|
+
echo "docker is not running - this is required to build container images for the UI Plugins"
|
|
188
|
+
exit 1
|
|
189
|
+
fi
|
|
179
190
|
fi
|
|
180
191
|
fi
|
|
181
192
|
|
|
@@ -354,8 +365,8 @@ if [ "${GITHUB_BUILD}" == "false" ]; then
|
|
|
354
365
|
echo -e "${CYAN}Base extension: ${BASE_EXT}${RESET}"
|
|
355
366
|
echo -e "${CYAN}Extension version: ${EXT_VERSION}${RESET}"
|
|
356
367
|
|
|
357
|
-
# Build the
|
|
358
|
-
${SCRIPT_DIR}/bundle ${BASE_EXT} ${EXT_VERSION} ${REGISTRY} ${REGISTRY_ORG} ${IMAGE_PREFIX} ${PUSH}
|
|
368
|
+
# Build the container image
|
|
369
|
+
${SCRIPT_DIR}/bundle "${BASE_EXT}" "${EXT_VERSION}" "${REGISTRY}" "${REGISTRY_ORG}" "${IMAGE_PREFIX}" "${PUSH}" "${PODMAN_CONTAINER}"
|
|
359
370
|
else
|
|
360
371
|
rm -rf ${CHART_TEMPLATE}
|
|
361
372
|
fi
|
|
@@ -386,5 +397,5 @@ fi
|
|
|
386
397
|
rm -rf ${CHART_TMP}
|
|
387
398
|
|
|
388
399
|
if [ "${GITHUB_BUILD}" == "false" ]; then
|
|
389
|
-
rm -rf ${TMP}
|
|
400
|
+
rm -rf ${TMP} ${ASSETS} ${CHARTS} ${BASE_DIR}/extensions ${BASE_DIR}/dist-pkg ${ROOT_INDEX}
|
|
390
401
|
fi
|