@kalisio/kdk 2.5.2 → 2.6.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/.github/workflows/main.yaml +35 -6
- package/client.globe.js +8 -0
- package/client.js +8 -0
- package/client.map.js +8 -0
- package/core/api/hooks/hooks.push.js +3 -2
- package/core/api/hooks/hooks.tags.js +56 -0
- package/core/api/models/tags.model.mongodb.js +8 -0
- package/core/api/services/index.js +33 -2
- package/core/api/services/tags/tags.hooks.js +47 -0
- package/core/client/api.js +5 -5
- package/core/client/components/KActivity.vue +3 -2
- package/core/client/components/KChip.vue +2 -2
- package/core/client/components/KEditor.vue +3 -1
- package/core/client/components/KFollower.vue +4 -4
- package/core/client/components/KStore.vue +1 -1
- package/core/client/components/KTab.vue +20 -7
- package/core/client/components/account/KProfile.vue +9 -25
- package/core/client/components/action/KAction.vue +10 -10
- package/core/client/components/action/KToggleFullscreenAction.vue +2 -11
- package/core/client/components/app/KHome.vue +3 -2
- package/core/client/components/collection/KFilter.vue +5 -4
- package/core/client/components/collection/KGrid.vue +5 -1
- package/core/client/components/collection/KItemsFilter.vue +47 -0
- package/core/client/components/collection/KItemsSorter.vue +42 -0
- package/core/client/components/collection/KScrollDown.vue +2 -2
- package/core/client/components/collection/KSearchFilterControl.vue +3 -2
- package/core/client/components/collection/KSorter.vue +33 -37
- package/core/client/components/collection/KTagsFilterControl.vue +14 -40
- package/core/client/components/collection/KTagsFilterView.vue +10 -45
- package/core/client/components/collection/KTimeFilterControl.vue +6 -7
- package/core/client/components/collection/KTimeFilterView.vue +13 -22
- package/core/client/components/collection/KTimeLine.vue +18 -9
- package/core/client/components/form/KColorField.vue +13 -6
- package/core/client/components/form/KColorScaleField.vue +7 -12
- package/core/client/components/form/KFileField.vue +118 -89
- package/core/client/components/form/KForm.vue +30 -18
- package/core/client/components/form/KIconField.vue +4 -1
- package/core/client/components/form/KNumberField.vue +9 -2
- package/core/client/components/form/KSelectField.vue +1 -4
- package/core/client/components/form/KTagField.vue +229 -0
- package/core/client/components/form/KTextField.vue +4 -0
- package/core/client/components/form/KTextareaField.vue +3 -1
- package/core/client/components/input/KShapePicker.vue +5 -5
- package/core/client/components/layout/KFab.vue +32 -20
- package/core/client/components/layout/KPage.vue +11 -6
- package/core/client/components/layout/KWindow.vue +5 -0
- package/core/client/components/media/index.js +2 -6
- package/core/client/components/menu/KMenu.vue +12 -10
- package/core/client/components/menu/KSubMenu.vue +12 -12
- package/core/client/components/messages/KMessageCard.vue +13 -12
- package/core/client/components/messages/KMessageComposer.vue +13 -9
- package/core/client/components/messages/KMessagesTimeLine.vue +16 -8
- package/core/client/components/tags/KTagFilter.vue +99 -0
- package/core/client/components/tags/KTagItem.vue +65 -0
- package/core/client/components/tags/KTagManager.vue +198 -0
- package/core/client/components/tags/KTagSelection.vue +82 -0
- package/core/client/components/time/KDate.vue +3 -17
- package/core/client/components/time/KDateTime.vue +1 -1
- package/core/client/components/time/KTime.vue +0 -4
- package/core/client/composables/collection-filter.js +41 -2
- package/core/client/composables/collection.js +3 -3
- package/core/client/composables/index.js +1 -0
- package/core/client/composables/pwa.js +13 -0
- package/core/client/composables/session.js +7 -8
- package/core/client/composables/user.js +36 -0
- package/core/client/directives/index.js +1 -0
- package/core/client/directives/v-drop-file.js +174 -0
- package/core/client/document.js +2 -1
- package/core/client/exporter.js +17 -3
- package/core/client/i18n/core_en.json +34 -7
- package/core/client/i18n/core_fr.json +36 -9
- package/core/client/i18n.js +26 -11
- package/core/client/layout.js +5 -5
- package/core/client/mixins/mixin.base-activity.js +8 -5
- package/core/client/mixins/mixin.base-editor.js +2 -1
- package/core/client/mixins/mixin.base-field.js +3 -2
- package/core/client/mixins/mixin.base-item.js +12 -10
- package/core/client/mixins/mixin.service.js +3 -1
- package/core/client/platform.js +0 -3
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/utils/index.js +2 -0
- package/core/client/utils/utils.collection.js +6 -6
- package/core/client/utils/utils.colors.js +46 -19
- package/core/client/utils/utils.files.js +19 -0
- package/core/client/utils/utils.locale.js +13 -17
- package/core/client/utils/utils.services.js +27 -0
- package/core/client/utils/utils.shapes.js +2 -2
- package/core/client/utils/utils.tags.js +17 -0
- package/core/client/utils/utils.tours.js +31 -0
- package/core/common/permissions.js +3 -0
- package/core/common/schemas/tags.update.json +35 -0
- package/core/common/schemas/users.update-profile.json +1 -1
- package/core/common/utils.js +5 -5
- package/extras/configs/panes.top.js +11 -0
- package/extras/configs/stickies.js +1 -1
- package/extras/configs/widgets.left.js +13 -1
- package/extras/libs/jsts.min.js +8 -0
- package/{test/client/core/account.js → extras/tests/core/account.mjs} +4 -4
- package/extras/tests/core/api.mjs +114 -0
- package/{test/client/core/collection.js → extras/tests/core/collection.mjs} +8 -8
- package/{test/client/core/dialogs.js → extras/tests/core/dialogs.mjs} +1 -1
- package/extras/tests/core/index.mjs +9 -0
- package/{test/client/core/layout.js → extras/tests/core/layout.mjs} +7 -3
- package/{test/client/core/runner.js → extras/tests/core/runner.mjs} +3 -3
- package/{test/client/core/screens.js → extras/tests/core/screens.mjs} +1 -1
- package/{test/client/core/utils.js → extras/tests/core/utils.mjs} +79 -26
- package/extras/tests/index.mjs +4 -0
- package/{test/client/map/api.js → extras/tests/map/api.mjs} +1 -1
- package/{test/client/map/catalog.js → extras/tests/map/catalog.mjs} +18 -18
- package/{test/client/map/controls.js → extras/tests/map/controls.mjs} +3 -3
- package/extras/tests/map/index.mjs +5 -0
- package/{test/client/map/time.js → extras/tests/map/time.mjs} +3 -3
- package/{test/client/map/utils.js → extras/tests/map/utils.mjs} +6 -5
- package/extras/tours/fab.js +36 -0
- package/extras/tours/layout.js +49 -0
- package/extras/tours/pane.left.js +78 -0
- package/extras/tours/pane.right.js +145 -0
- package/extras/tours/pane.top.js +239 -0
- package/map/api/config/layers.cjs +28 -13
- package/map/api/hooks/hooks.query.js +12 -7
- package/map/api/models/catalog.model.mongodb.js +17 -6
- package/map/api/services/catalog/catalog.hooks.js +1 -1
- package/map/api/services/index.js +18 -1
- package/map/api/services/styles/styles.hooks.js +1 -1
- package/map/client/cesium/utils/utils.cesium.js +25 -65
- package/map/client/cesium/utils/utils.features.js +1 -0
- package/map/client/cesium/utils/utils.geojson.js +1 -0
- package/map/client/cesium/utils/utils.style.js +7 -6
- package/map/client/components/KFeatureEditor.vue +3 -3
- package/map/client/components/KFeaturesChart.vue +4 -4
- package/map/client/components/KFeaturesFilterEditor.vue +19 -13
- package/map/client/components/KFeaturesFilterManager.vue +7 -4
- package/map/client/components/KFeaturesTable.vue +2 -2
- package/map/client/components/KLayerEditor.vue +10 -6
- package/map/client/components/KMeasureTool.vue +2 -1
- package/map/client/components/catalog/KBaseLayersSelector.vue +1 -1
- package/map/client/components/catalog/KCategoryItem.vue +15 -1
- package/map/client/components/catalog/KConnectLayer.vue +2 -2
- package/map/client/components/catalog/KCreateView.vue +3 -2
- package/map/client/components/catalog/KFilteredLayerItem.vue +26 -6
- package/map/client/components/catalog/KImportLayer.vue +6 -3
- package/map/client/components/catalog/KLayerCategories.vue +8 -6
- package/map/client/components/catalog/KLayerItem.vue +12 -2
- package/map/client/components/catalog/KLayersList.vue +180 -0
- package/map/client/components/catalog/KLayersPanel.vue +146 -36
- package/map/client/components/catalog/KLayersSelector.vue +96 -48
- package/map/client/components/catalog/KProjectEditor.vue +0 -9
- package/map/client/components/catalog/KProjectSelector.vue +3 -2
- package/map/client/components/catalog/KProjectsPanel.vue +23 -8
- package/map/client/components/catalog/KViewsPanel.vue +18 -8
- package/map/client/components/catalog/KWeatherLayersSelector.vue +3 -3
- package/map/client/components/form/KDirectionField.vue +3 -6
- package/map/client/components/form/KLayerCategoryField.vue +2 -2
- package/map/client/components/form/KOwsServiceField.vue +25 -24
- package/map/client/components/form/KSelectLayersField.vue +4 -4
- package/map/client/components/form/KSelectViewsField.vue +4 -4
- package/map/client/components/legend/KLayerLegend.vue +11 -2
- package/map/client/components/legend/KLegend.vue +44 -51
- package/map/client/components/location/KLocationCardSection.vue +6 -7
- package/map/client/components/location/KLocationMap.vue +23 -13
- package/map/client/components/stickies/KLevelSlider.vue +10 -8
- package/map/client/components/stickies/KPosition.vue +5 -0
- package/map/client/components/styles/KLayerStyleAction.vue +59 -12
- package/map/client/components/styles/KStyleEditor.vue +72 -9
- package/map/client/components/styles/KStyleEditorSection.vue +82 -33
- package/map/client/components/styles/KStyleManager.vue +126 -60
- package/map/client/components/styles/KStylePreview.vue +9 -25
- package/map/client/components/styles/KStylePreviewItem.vue +22 -1
- package/map/client/components/tools/KSearchTool.vue +1 -1
- package/map/client/components/widget/KElevationProfile.vue +20 -17
- package/map/client/components/widget/KInformationBox.vue +5 -5
- package/map/client/components/widget/KMapillaryViewer.vue +2 -1
- package/map/client/components/widget/KTimeSeries.vue +11 -9
- package/map/client/composables/highlight.js +5 -1
- package/map/client/globe.js +2 -0
- package/map/client/i18n/map_en.json +33 -8
- package/map/client/i18n/map_fr.json +33 -8
- package/map/client/leaflet/GradientPath.js +61 -24
- package/map/client/leaflet/ShapeMarker.js +12 -5
- package/map/client/leaflet/TiledMeshLayer.js +3 -3
- package/map/client/leaflet/utils/utils.geojson.js +66 -8
- package/map/client/leaflet/utils/utils.style.js +14 -15
- package/map/client/mixins/globe/mixin.base-globe.js +181 -34
- package/map/client/mixins/globe/mixin.file-layers.js +3 -0
- package/map/client/mixins/globe/mixin.geojson-layers.js +190 -36
- package/map/client/mixins/globe/mixin.opendap-layers.js +2 -1
- package/map/client/mixins/globe/mixin.style.js +23 -1
- package/map/client/mixins/globe/mixin.tooltip.js +14 -2
- package/map/client/mixins/map/mixin.base-map.js +146 -58
- package/map/client/mixins/map/mixin.edit-layers.js +18 -15
- package/map/client/mixins/map/mixin.geojson-layers.js +181 -106
- package/map/client/mixins/map/mixin.heatmap-layers.js +3 -2
- package/map/client/mixins/map/mixin.map-activity.js +6 -1
- package/map/client/mixins/map/mixin.mapillary-layers.js +2 -1
- package/map/client/mixins/map/mixin.pmtiles-layers.js +3 -3
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +3 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +3 -2
- package/map/client/mixins/mixin.activity.js +203 -48
- package/map/client/mixins/mixin.context.js +11 -11
- package/map/client/mixins/mixin.feature-service.js +11 -9
- package/map/client/mixins/mixin.weacast.js +5 -3
- package/map/client/readers/reader.geojson.js +3 -1
- package/map/client/utils/utils.capture.js +3 -3
- package/map/client/utils/utils.catalog.js +9 -5
- package/map/client/utils/utils.features.js +120 -54
- package/map/client/utils/utils.js +25 -10
- package/map/client/utils/utils.layers.js +148 -26
- package/map/client/utils/utils.location.js +26 -9
- package/map/client/utils/utils.schema.js +2 -1
- package/map/client/utils/utils.style.js +53 -9
- package/map/common/geotiff-grid-source.js +1 -3
- package/map/common/opendap-utils.js +0 -1
- package/map/common/tms-utils.js +0 -1
- package/map/common/wcs-utils.js +0 -1
- package/map/common/wfs-utils.js +0 -1
- package/map/common/wms-utils.js +7 -1
- package/map/common/wmts-utils.js +0 -1
- package/package.json +12 -12
- package/scripts/init_runner.sh +3 -3
- package/scripts/kash/CHANGELOG.md +27 -0
- package/scripts/kash/kash.sh +556 -237
- package/scripts/kash/scripts/run_tests.sh +44 -5
- package/scripts/setup_workspace.sh +23 -13
- package/test/api/core/config/default.cjs +2 -1
- package/test/api/core/push.test.js +1 -1
- package/test/api/core/tags.test.js +62 -0
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/config/layers.json +9 -0
- package/test/api/map/data/openradiation.json +13811 -0
- package/test/api/map/grid-sources.test.js +1 -3
- package/test/api/map/index.test.js +60 -1
- package/test/api/map/style.test.js +30 -1
- package/test.api.js +1 -1
- package/vite/App.vue +18 -0
- package/vite/AppWithGlobe.vue +84 -0
- package/vite/GlobeActivity.vue +58 -0
- package/vite/MapActivity.vue +63 -0
- package/vite/MapActivityWithGlobe.vue +63 -0
- package/vite/README.md +169 -0
- package/vite/config.js +221 -0
- package/vite/index_with_globe.html +50 -0
- package/vite/index_with_map.html +50 -0
- package/vite/package.json +173 -0
- package/vite/quasar.variables.scss +17 -0
- package/vite/vite.config.js +166 -0
- package/vite/yarn.lock +11641 -0
- package/core/client/components/media/KImageViewer.vue +0 -68
- package/core/client/components/media/KMarkdownViewer.vue +0 -55
- package/core/client/components/media/KMediaBrowser.vue +0 -301
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/core/api/application.js.html +0 -1870
- package/coverage/core/api/authentication.js.html +0 -874
- package/coverage/core/api/db.js.html +0 -793
- package/coverage/core/api/hooks/hooks.authentication.js.html +0 -139
- package/coverage/core/api/hooks/hooks.authorisations.js.html +0 -955
- package/coverage/core/api/hooks/hooks.groups.js.html +0 -229
- package/coverage/core/api/hooks/hooks.logger.js.html +0 -163
- package/coverage/core/api/hooks/hooks.model.js.html +0 -955
- package/coverage/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/core/api/hooks/hooks.push.js.html +0 -265
- package/coverage/core/api/hooks/hooks.query.js.html +0 -862
- package/coverage/core/api/hooks/hooks.schemas.js.html +0 -298
- package/coverage/core/api/hooks/hooks.service.js.html +0 -319
- package/coverage/core/api/hooks/hooks.storage.js.html +0 -193
- package/coverage/core/api/hooks/hooks.users.js.html +0 -595
- package/coverage/core/api/hooks/index.html +0 -266
- package/coverage/core/api/hooks/index.js.html +0 -115
- package/coverage/core/api/index.html +0 -176
- package/coverage/core/api/index.js.html +0 -148
- package/coverage/core/api/marshall.js.html +0 -448
- package/coverage/core/api/models/groups.model.mongodb.js.html +0 -109
- package/coverage/core/api/models/index.html +0 -131
- package/coverage/core/api/models/messages.model.mongodb.js.html +0 -121
- package/coverage/core/api/models/organisations.model.mongodb.js.html +0 -94
- package/coverage/core/api/models/tags.model.mongodb.js.html +0 -115
- package/coverage/core/api/models/users.model.mongodb.js.html +0 -115
- package/coverage/core/api/services/account/account.hooks.js.html +0 -208
- package/coverage/core/api/services/account/account.service.js.html +0 -436
- package/coverage/core/api/services/account/index.html +0 -131
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +0 -184
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +0 -532
- package/coverage/core/api/services/authorisations/index.html +0 -131
- package/coverage/core/api/services/databases/databases.hooks.js.html +0 -193
- package/coverage/core/api/services/databases/databases.service.js.html +0 -100
- package/coverage/core/api/services/databases/index.html +0 -131
- package/coverage/core/api/services/groups/groups.hooks.js.html +0 -178
- package/coverage/core/api/services/groups/index.html +0 -116
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +0 -184
- package/coverage/core/api/services/import-export/import-export.service.js.html +0 -118
- package/coverage/core/api/services/import-export/index.html +0 -131
- package/coverage/core/api/services/index.html +0 -116
- package/coverage/core/api/services/index.js.html +0 -520
- package/coverage/core/api/services/mailer/index.html +0 -131
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +0 -190
- package/coverage/core/api/services/mailer/mailer.service.js.html +0 -118
- package/coverage/core/api/services/messages/index.html +0 -116
- package/coverage/core/api/services/messages/messages.hooks.js.html +0 -199
- package/coverage/core/api/services/organisations/index.html +0 -131
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +0 -178
- package/coverage/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/core/api/services/push/index.html +0 -131
- package/coverage/core/api/services/push/push.hooks.js.html +0 -190
- package/coverage/core/api/services/push/push.service.js.html +0 -121
- package/coverage/core/api/services/storage/index.html +0 -131
- package/coverage/core/api/services/storage/storage.hooks.js.html +0 -190
- package/coverage/core/api/services/storage/storage.service.js.html +0 -172
- package/coverage/core/api/services/tags/index.html +0 -116
- package/coverage/core/api/services/tags/tags.hooks.js.html +0 -178
- package/coverage/core/api/services/users/index.html +0 -131
- package/coverage/core/api/services/users/users.hooks.js.html +0 -307
- package/coverage/core/api/services/users/users.service.js.html +0 -100
- package/coverage/core/api/utils.js.html +0 -118
- package/coverage/core/common/errors.js.html +0 -88
- package/coverage/core/common/index.html +0 -191
- package/coverage/core/common/index.js.html +0 -115
- package/coverage/core/common/permissions.js.html +0 -733
- package/coverage/core/common/schema.js.html +0 -190
- package/coverage/core/common/utils.js.html +0 -226
- package/coverage/core/common/utils.offline.js.html +0 -199
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -461
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/core/api/application.js.html +0 -1870
- package/coverage/lcov-report/core/api/authentication.js.html +0 -874
- package/coverage/lcov-report/core/api/db.js.html +0 -793
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +0 -139
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +0 -955
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +0 -229
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +0 -163
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +0 -955
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +0 -265
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +0 -862
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +0 -298
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +0 -319
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +0 -193
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +0 -595
- package/coverage/lcov-report/core/api/hooks/index.html +0 -266
- package/coverage/lcov-report/core/api/hooks/index.js.html +0 -115
- package/coverage/lcov-report/core/api/index.html +0 -176
- package/coverage/lcov-report/core/api/index.js.html +0 -148
- package/coverage/lcov-report/core/api/marshall.js.html +0 -448
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +0 -109
- package/coverage/lcov-report/core/api/models/index.html +0 -131
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +0 -121
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +0 -94
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +0 -115
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +0 -115
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +0 -208
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +0 -436
- package/coverage/lcov-report/core/api/services/account/index.html +0 -131
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +0 -184
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +0 -532
- package/coverage/lcov-report/core/api/services/authorisations/index.html +0 -131
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +0 -193
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +0 -100
- package/coverage/lcov-report/core/api/services/databases/index.html +0 -131
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/groups/index.html +0 -116
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +0 -184
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +0 -118
- package/coverage/lcov-report/core/api/services/import-export/index.html +0 -131
- package/coverage/lcov-report/core/api/services/index.html +0 -116
- package/coverage/lcov-report/core/api/services/index.js.html +0 -520
- package/coverage/lcov-report/core/api/services/mailer/index.html +0 -131
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +0 -118
- package/coverage/lcov-report/core/api/services/messages/index.html +0 -116
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +0 -199
- package/coverage/lcov-report/core/api/services/organisations/index.html +0 -131
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/lcov-report/core/api/services/push/index.html +0 -131
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +0 -121
- package/coverage/lcov-report/core/api/services/storage/index.html +0 -131
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +0 -172
- package/coverage/lcov-report/core/api/services/tags/index.html +0 -116
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/users/index.html +0 -131
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +0 -307
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +0 -100
- package/coverage/lcov-report/core/api/utils.js.html +0 -118
- package/coverage/lcov-report/core/common/errors.js.html +0 -88
- package/coverage/lcov-report/core/common/index.html +0 -191
- package/coverage/lcov-report/core/common/index.js.html +0 -115
- package/coverage/lcov-report/core/common/permissions.js.html +0 -733
- package/coverage/lcov-report/core/common/schema.js.html +0 -190
- package/coverage/lcov-report/core/common/utils.js.html +0 -226
- package/coverage/lcov-report/core/common/utils.offline.js.html +0 -199
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -461
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +0 -463
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +0 -397
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +0 -1309
- package/coverage/lcov-report/map/api/hooks/index.html +0 -161
- package/coverage/lcov-report/map/api/hooks/index.js.html +0 -94
- package/coverage/lcov-report/map/api/index.html +0 -131
- package/coverage/lcov-report/map/api/index.js.html +0 -139
- package/coverage/lcov-report/map/api/marshall.js.html +0 -178
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +0 -106
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +0 -127
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/lcov-report/map/api/models/index.html +0 -161
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +0 -109
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +0 -274
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +0 -610
- package/coverage/lcov-report/map/api/services/alerts/index.html +0 -131
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +0 -313
- package/coverage/lcov-report/map/api/services/catalog/index.html +0 -116
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +0 -1510
- package/coverage/lcov-report/map/api/services/daptiles/index.html +0 -116
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +0 -310
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +0 -544
- package/coverage/lcov-report/map/api/services/features/index.html +0 -131
- package/coverage/lcov-report/map/api/services/index.html +0 -116
- package/coverage/lcov-report/map/api/services/index.js.html +0 -946
- package/coverage/lcov-report/map/api/services/projects/index.html +0 -116
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +0 -439
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +0 -466
- package/coverage/lcov-report/map/common/errors.js.html +0 -94
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +0 -544
- package/coverage/lcov-report/map/common/grid.js.html +0 -1612
- package/coverage/lcov-report/map/common/index.html +0 -371
- package/coverage/lcov-report/map/common/index.js.html +0 -172
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +0 -556
- package/coverage/lcov-report/map/common/moment-utils.js.html +0 -157
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +0 -868
- package/coverage/lcov-report/map/common/opendap-utils.js.html +0 -826
- package/coverage/lcov-report/map/common/permissions.js.html +0 -124
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +0 -418
- package/coverage/lcov-report/map/common/tms-utils.js.html +0 -274
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +0 -364
- package/coverage/lcov-report/map/common/wcs-utils.js.html +0 -586
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +0 -1033
- package/coverage/lcov-report/map/common/wfs-utils.js.html +0 -574
- package/coverage/lcov-report/map/common/wms-utils.js.html +0 -451
- package/coverage/lcov-report/map/common/wmts-utils.js.html +0 -547
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -10392
- package/coverage/map/api/hooks/hooks.catalog.js.html +0 -463
- package/coverage/map/api/hooks/hooks.features.js.html +0 -397
- package/coverage/map/api/hooks/hooks.query.js.html +0 -1309
- package/coverage/map/api/hooks/index.html +0 -161
- package/coverage/map/api/hooks/index.js.html +0 -94
- package/coverage/map/api/index.html +0 -131
- package/coverage/map/api/index.js.html +0 -139
- package/coverage/map/api/marshall.js.html +0 -178
- package/coverage/map/api/models/alerts.model.mongodb.js.html +0 -106
- package/coverage/map/api/models/catalog.model.mongodb.js.html +0 -127
- package/coverage/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/map/api/models/index.html +0 -161
- package/coverage/map/api/models/projects.model.mongodb.js.html +0 -109
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +0 -274
- package/coverage/map/api/services/alerts/alerts.service.js.html +0 -610
- package/coverage/map/api/services/alerts/index.html +0 -131
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +0 -313
- package/coverage/map/api/services/catalog/index.html +0 -116
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +0 -1510
- package/coverage/map/api/services/daptiles/index.html +0 -116
- package/coverage/map/api/services/features/features.hooks.js.html +0 -310
- package/coverage/map/api/services/features/features.service.js.html +0 -544
- package/coverage/map/api/services/features/index.html +0 -131
- package/coverage/map/api/services/index.html +0 -116
- package/coverage/map/api/services/index.js.html +0 -946
- package/coverage/map/api/services/projects/index.html +0 -116
- package/coverage/map/api/services/projects/projects.hooks.js.html +0 -439
- package/coverage/map/common/dynamic-grid-source.js.html +0 -466
- package/coverage/map/common/errors.js.html +0 -94
- package/coverage/map/common/geotiff-grid-source.js.html +0 -544
- package/coverage/map/common/grid.js.html +0 -1612
- package/coverage/map/common/index.html +0 -371
- package/coverage/map/common/index.js.html +0 -172
- package/coverage/map/common/meteo-model-grid-source.js.html +0 -556
- package/coverage/map/common/moment-utils.js.html +0 -157
- package/coverage/map/common/opendap-grid-source.js.html +0 -868
- package/coverage/map/common/opendap-utils.js.html +0 -826
- package/coverage/map/common/permissions.js.html +0 -124
- package/coverage/map/common/time-based-grid-source.js.html +0 -418
- package/coverage/map/common/tms-utils.js.html +0 -274
- package/coverage/map/common/wcs-grid-source.js.html +0 -364
- package/coverage/map/common/wcs-utils.js.html +0 -586
- package/coverage/map/common/weacast-grid-source.js.html +0 -1033
- package/coverage/map/common/wfs-utils.js.html +0 -574
- package/coverage/map/common/wms-utils.js.html +0 -451
- package/coverage/map/common/wmts-utils.js.html +0 -547
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/tmp/coverage-122123-1739872365211-0.json +0 -1
- package/coverage/tmp/coverage-122135-1739872365196-0.json +0 -1
- package/coverage/tmp/coverage-122146-1739872365184-0.json +0 -1
- package/coverage/tmp/coverage-122158-1739872365169-0.json +0 -1
- package/coverage/tmp/coverage-122165-1739872365141-0.json +0 -1
- package/extras/tours/core/account-profile.js +0 -32
- package/extras/tours/core/account.js +0 -143
- package/extras/tours/core/add-member.js +0 -75
- package/extras/tours/core/add-tag.js +0 -13
- package/extras/tours/core/create-group.js +0 -19
- package/extras/tours/core/create-organisation.js +0 -19
- package/extras/tours/core/create-tag.js +0 -26
- package/extras/tours/core/edit-member-role.js +0 -13
- package/extras/tours/core/groups.js +0 -65
- package/extras/tours/core/join-group.js +0 -13
- package/extras/tours/core/login.js +0 -41
- package/extras/tours/core/members.js +0 -108
- package/extras/tours/core/register.js +0 -61
- package/extras/tours/core/send-reset-password.js +0 -14
- package/extras/tours/core/tags.js +0 -65
- package/extras/tours/map/catalog-panel.js +0 -112
- package/extras/tours/map/fab.js +0 -26
- package/extras/tours/map/navigation-bar.js +0 -187
- package/extras/tours/map/side-nav.js +0 -36
- package/test/api/core/test-log-2025-05-26.log +0 -22
- package/test/api/map/test-log-2025-05-26.log +0 -12
- package/test/client/core/api.js +0 -361
- package/test/client/core/index.js +0 -9
- package/test/client/index.js +0 -4
- package/test/client/map/index.js +0 -5
- package/test.client.js +0 -1
- /package/{test/client/core/time.js → extras/tests/core/time.mjs} +0 -0
- /package/extras/tours/{map/add-layer.js → add-layer.js} +0 -0
- /package/extras/tours/{map/catalog-categories.js → catalog-categories.js} +0 -0
- /package/extras/tours/{map/connect-layer.js → connect-layer.js} +0 -0
- /package/extras/tours/{map/create-layer.js → create-layer.js} +0 -0
- /package/extras/tours/{map/create-view.js → create-view.js} +0 -0
- /package/extras/tours/{map/import-layer.js → import-layer.js} +0 -0
- /package/extras/tours/{map/timeline.js → pane.bottom.js} +0 -0
package/scripts/kash/kash.sh
CHANGED
|
@@ -18,7 +18,20 @@
|
|
|
18
18
|
. /etc/os-release
|
|
19
19
|
|
|
20
20
|
OS_ID=$ID
|
|
21
|
-
OS_VERSION=$VERSION_ID
|
|
21
|
+
OS_VERSION=${VERSION_ID:-}
|
|
22
|
+
|
|
23
|
+
# VERSION_ID is an optional field, do what we can to deduce when missing
|
|
24
|
+
if [[ "$OS_VERSION" = "" ]]; then
|
|
25
|
+
case "$OS_ID" in
|
|
26
|
+
debian)
|
|
27
|
+
OS_VERSION=$(cat /etc/debian_version)
|
|
28
|
+
OS_VERSION=${OS_VERSION%%.*}
|
|
29
|
+
;;
|
|
30
|
+
*)
|
|
31
|
+
OS_VERSION=unknown
|
|
32
|
+
;;
|
|
33
|
+
esac
|
|
34
|
+
fi
|
|
22
35
|
|
|
23
36
|
echo "Running on ${OS_ID}-${OS_VERSION}"
|
|
24
37
|
|
|
@@ -43,11 +56,11 @@ fi
|
|
|
43
56
|
|
|
44
57
|
if [ -n "$CI_ID" ]; then
|
|
45
58
|
CI=true
|
|
46
|
-
echo "Running in CI mode ($CI_ID)..."
|
|
59
|
+
echo "Running in CI mode ($CI_ID) ..."
|
|
47
60
|
|
|
48
61
|
# Make sure we have the requirements to run kash functions
|
|
49
62
|
set +e
|
|
50
|
-
command -v curl >/dev/null 2>&1 && command -v git >/dev/null 2>&1 && command -v sha256sum >/dev/null 2>&1
|
|
63
|
+
command -v curl >/dev/null 2>&1 && command -v git >/dev/null 2>&1 && command -v sha256sum >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1
|
|
51
64
|
RC=$?
|
|
52
65
|
set -e
|
|
53
66
|
|
|
@@ -55,13 +68,13 @@ if [ -n "$CI_ID" ]; then
|
|
|
55
68
|
case "$OS_ID" in
|
|
56
69
|
debian | ubuntu)
|
|
57
70
|
if [ "$(id -u)" -eq 0 ]; then
|
|
58
|
-
apt-get update && apt-get --no-install-recommends --yes install sudo curl ca-certificates coreutils git
|
|
71
|
+
apt-get update && apt-get --no-install-recommends --yes install sudo curl ca-certificates coreutils git unzip
|
|
59
72
|
else
|
|
60
|
-
sudo apt-get update && sudo apt-get --no-install-recommends --yes install curl ca-certificates coreutils git
|
|
73
|
+
sudo apt-get update && sudo apt-get --no-install-recommends --yes install curl ca-certificates coreutils git unzip
|
|
61
74
|
fi
|
|
62
75
|
;;
|
|
63
76
|
alpine)
|
|
64
|
-
apk update && apk add curl ca-certificates coreutils git
|
|
77
|
+
apk update && apk add curl ca-certificates coreutils git unzip
|
|
65
78
|
;;
|
|
66
79
|
*)
|
|
67
80
|
;;
|
|
@@ -92,6 +105,12 @@ if [ -d "$HOME/.nvm" ]; then
|
|
|
92
105
|
. "$HOME/.nvm/nvm.sh"
|
|
93
106
|
fi
|
|
94
107
|
|
|
108
|
+
# If sonar-scanner-cli is present, add it to PATH
|
|
109
|
+
# See install_sonar_scanner_cli
|
|
110
|
+
if [ -d "$HOME/.local/sonar-scanner" ]; then
|
|
111
|
+
export PATH=$PATH:$HOME/.local/sonar-scanner/bin
|
|
112
|
+
fi
|
|
113
|
+
|
|
95
114
|
# Define a TMP_DIR to operate with temp files
|
|
96
115
|
if [ -n "${RUNNER_TEMP:-}" ]; then # RUNNER_TEMP is Github Action specific
|
|
97
116
|
TMP_DIR="$RUNNER_TEMP"
|
|
@@ -110,27 +129,24 @@ AGE_VERSION=1.1.1
|
|
|
110
129
|
SOPS_VERSION=3.8.1
|
|
111
130
|
|
|
112
131
|
# https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG
|
|
113
|
-
KUBECTL_VERSION=1.
|
|
132
|
+
KUBECTL_VERSION=1.28.13
|
|
114
133
|
# https://github.com/helm/helm/releases
|
|
115
|
-
HELM_VERSION=3.
|
|
134
|
+
HELM_VERSION=3.14.4
|
|
116
135
|
# https://github.com/helmfile/helmfile/releases
|
|
117
|
-
HELMFILE_VERSION=0.
|
|
118
|
-
# https://github.com/derailed/k9s/releases
|
|
119
|
-
K9S_VERSION=0.32.4
|
|
136
|
+
HELMFILE_VERSION=0.167.1
|
|
120
137
|
|
|
121
138
|
# https://github.com/nvm-sh/nvm/releases
|
|
122
|
-
NVM_VERSION=0.
|
|
139
|
+
NVM_VERSION=0.40.3
|
|
123
140
|
# https://nodejs.org/en/about/previous-releases#looking-for-latest-release-of-a-version-branch
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
NODE20_VERSION=20.11.1
|
|
127
|
-
NODE22_VERSION=22.3.0
|
|
141
|
+
NODE20_VERSION=20.19
|
|
142
|
+
NODE22_VERSION=22.16
|
|
128
143
|
|
|
129
144
|
# https://www.mongodb.com/try/download/community
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
MONGODB7_VERSION=7.0.21
|
|
146
|
+
MONGODB8_VERSION=8.0.10
|
|
147
|
+
|
|
148
|
+
# https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/
|
|
149
|
+
SONAR_SCANNER_CLI_VERSION=6.2.1.4610
|
|
134
150
|
|
|
135
151
|
# Install yq in ~/.local/bin
|
|
136
152
|
# Arg1: a writable folder where to write downloaded files
|
|
@@ -250,9 +266,11 @@ install_cc_test_reporter() {
|
|
|
250
266
|
|
|
251
267
|
# Sends test coverage to code climate
|
|
252
268
|
# Arg1: code climate identifier for authentication
|
|
269
|
+
# Arg2: prefix to use when using format-coverage (can be empty)
|
|
253
270
|
send_coverage_to_cc() {
|
|
254
271
|
local CC_TEST_REPORTER_ID=$1
|
|
255
|
-
|
|
272
|
+
local CC_PREFIX=${2:-}
|
|
273
|
+
~/.local/bin/cc-test-reporter format-coverage -t lcov --add-prefix "$CC_PREFIX" coverage/lcov.info
|
|
256
274
|
~/.local/bin/cc-test-reporter upload-coverage -r "$CC_TEST_REPORTER_ID"
|
|
257
275
|
}
|
|
258
276
|
|
|
@@ -301,121 +319,71 @@ install_node22() {
|
|
|
301
319
|
bash -i -c "nvm install $NODE22_VERSION"
|
|
302
320
|
}
|
|
303
321
|
|
|
304
|
-
# Install
|
|
305
|
-
# Arg1: a writable folder where to write downloaded files
|
|
306
|
-
# NOTE: each mongo version is installed in a separate folder to support multiple versions
|
|
307
|
-
install_mongo4() {
|
|
308
|
-
local DL_ROOT=$1
|
|
309
|
-
local DL_PATH="$DL_ROOT/mongo4"
|
|
310
|
-
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
311
|
-
case "$OS_ID" in
|
|
312
|
-
debian)
|
|
313
|
-
curl -OLsS http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb
|
|
314
|
-
DEBIAN_FRONTEND=noninteractive && dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb
|
|
315
|
-
local MONGODB_SUFFIX=debian10-${MONGODB4_VERSION}
|
|
316
|
-
;;
|
|
317
|
-
ubuntu)
|
|
318
|
-
# NOTE: this assumes ubuntu 22.04
|
|
319
|
-
curl -OLss http://launchpadlibrarian.net/715615335/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
|
|
320
|
-
DEBIAN_FRONTEND=noninteractive && sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
|
|
321
|
-
local MONGODB_SUFFIX=ubuntu2004-${MONGODB4_VERSION}
|
|
322
|
-
;;
|
|
323
|
-
*)
|
|
324
|
-
esac
|
|
325
|
-
|
|
326
|
-
curl -OLsS "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
327
|
-
tar xf "mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
328
|
-
mkdir -p ~/.local/bin/mongo4
|
|
329
|
-
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/mongo4
|
|
330
|
-
sudo mkdir -p /var/lib/mongo4 && sudo mkdir -p /var/log/mongodb4
|
|
331
|
-
sudo chmod a+rwx /var/lib/mongo4 && sudo chmod a+rwx /var/log/mongodb4
|
|
332
|
-
cd ~-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
# Install mongo5 in ~/.local/bin/mongo5
|
|
322
|
+
# Install mongo7 in ~/.local/bin/mongo7
|
|
336
323
|
# Arg1: a writable folder where to write downloaded files
|
|
337
324
|
# NOTE: each mongo version is installed in a separate folder to support multiple versions
|
|
338
|
-
|
|
325
|
+
install_mongo7() {
|
|
339
326
|
local DL_ROOT=$1
|
|
340
|
-
local DL_PATH="$DL_ROOT/
|
|
327
|
+
local DL_PATH="$DL_ROOT/mongo7"
|
|
341
328
|
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
342
329
|
case "$OS_ID" in
|
|
343
330
|
debian)
|
|
344
|
-
|
|
345
|
-
DEBIAN_FRONTEND=noninteractive && dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb
|
|
346
|
-
local MONGODB_SUFFIX=debian11-${MONGODB5_VERSION}
|
|
331
|
+
local MONGODB_SUFFIX=debian12-${MONGODB7_VERSION}
|
|
347
332
|
;;
|
|
348
333
|
ubuntu)
|
|
349
|
-
|
|
350
|
-
curl -OLss http://launchpadlibrarian.net/715615335/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
|
|
351
|
-
DEBIAN_FRONTEND=noninteractive && sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
|
|
352
|
-
local MONGODB_SUFFIX=ubuntu2004-${MONGODB5_VERSION}
|
|
334
|
+
local MONGODB_SUFFIX=ubuntu2204-${MONGODB7_VERSION}
|
|
353
335
|
;;
|
|
354
336
|
*)
|
|
355
337
|
esac
|
|
356
338
|
|
|
357
339
|
curl -OLsS "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
358
340
|
tar xf "mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
359
|
-
mkdir -p ~/.local/bin/
|
|
360
|
-
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/
|
|
361
|
-
sudo mkdir -p /var/lib/
|
|
362
|
-
sudo chmod a+rwx /var/lib/
|
|
341
|
+
mkdir -p ~/.local/bin/mongo7
|
|
342
|
+
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/mongo7
|
|
343
|
+
sudo mkdir -p /var/lib/mongo7 && sudo mkdir -p /var/log/mongodb7
|
|
344
|
+
sudo chmod a+rwx /var/lib/mongo7 && sudo chmod a+rwx /var/log/mongodb7
|
|
363
345
|
cd ~-
|
|
364
346
|
}
|
|
365
347
|
|
|
366
|
-
# Install
|
|
348
|
+
# Install mongo8 in ~/.local/bin/mongo8
|
|
367
349
|
# Arg1: a writable folder where to write downloaded files
|
|
368
350
|
# NOTE: each mongo version is installed in a separate folder to support multiple versions
|
|
369
|
-
|
|
351
|
+
install_mongo8() {
|
|
370
352
|
local DL_ROOT=$1
|
|
371
|
-
local DL_PATH="$DL_ROOT/
|
|
353
|
+
local DL_PATH="$DL_ROOT/mongo8"
|
|
372
354
|
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
373
355
|
case "$OS_ID" in
|
|
374
356
|
debian)
|
|
375
|
-
|
|
376
|
-
DEBIAN_FRONTEND=noninteractive && dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb
|
|
377
|
-
local MONGODB_SUFFIX=debian11-${MONGODB6_VERSION}
|
|
357
|
+
local MONGODB_SUFFIX=debian12-${MONGODB8_VERSION}
|
|
378
358
|
;;
|
|
379
359
|
ubuntu)
|
|
380
|
-
local MONGODB_SUFFIX=ubuntu2204-${
|
|
360
|
+
local MONGODB_SUFFIX=ubuntu2204-${MONGODB8_VERSION}
|
|
381
361
|
;;
|
|
382
362
|
*)
|
|
383
363
|
esac
|
|
384
364
|
|
|
385
365
|
curl -OLsS "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
386
366
|
tar xf "mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
387
|
-
mkdir -p ~/.local/bin/
|
|
388
|
-
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/
|
|
389
|
-
sudo mkdir -p /var/lib/
|
|
390
|
-
sudo chmod a+rwx /var/lib/
|
|
367
|
+
mkdir -p ~/.local/bin/mongo8
|
|
368
|
+
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/mongo8
|
|
369
|
+
sudo mkdir -p /var/lib/mongo8 && sudo mkdir -p /var/log/mongodb8
|
|
370
|
+
sudo chmod a+rwx /var/lib/mongo8 && sudo chmod a+rwx /var/log/mongodb8
|
|
391
371
|
cd ~-
|
|
392
372
|
}
|
|
393
373
|
|
|
394
|
-
# Install
|
|
374
|
+
# Install sonar-scanner in ~/.local/sonar-scanner-cli
|
|
395
375
|
# Arg1: a writable folder where to write downloaded files
|
|
396
|
-
|
|
397
|
-
install_mongo7() {
|
|
376
|
+
install_sonar_scanner_cli() {
|
|
398
377
|
local DL_ROOT=$1
|
|
399
|
-
local DL_PATH="$DL_ROOT/
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
local MONGODB_SUFFIX=ubuntu2204-${MONGODB7_VERSION}
|
|
409
|
-
;;
|
|
410
|
-
*)
|
|
411
|
-
esac
|
|
412
|
-
|
|
413
|
-
curl -OLsS "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
414
|
-
tar xf "mongodb-linux-x86_64-${MONGODB_SUFFIX}.tgz"
|
|
415
|
-
mkdir -p ~/.local/bin/mongo7
|
|
416
|
-
cp -fR "mongodb-linux-x86_64-${MONGODB_SUFFIX}/bin/mongod" ~/.local/bin/mongo7
|
|
417
|
-
sudo mkdir -p /var/lib/mongo7 && sudo mkdir -p /var/log/mongodb7
|
|
418
|
-
sudo chmod a+rwx /var/lib/mongo7 && sudo chmod a+rwx /var/log/mongodb7
|
|
378
|
+
local DL_PATH="$DL_ROOT/sonarscannercli"
|
|
379
|
+
if [ ! -d "$DL_PATH" ]; then
|
|
380
|
+
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
381
|
+
curl -OLsS https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux-x64.zip
|
|
382
|
+
unzip sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux-x64.zip
|
|
383
|
+
cd ~-
|
|
384
|
+
fi
|
|
385
|
+
cd "$DL_PATH"
|
|
386
|
+
mv sonar-scanner-${SONAR_SCANNER_CLI_VERSION}-linux-x64 ~/.local/sonar-scanner
|
|
419
387
|
cd ~-
|
|
420
388
|
}
|
|
421
389
|
|
|
@@ -476,25 +444,6 @@ install_helmfile() {
|
|
|
476
444
|
cd ~-
|
|
477
445
|
}
|
|
478
446
|
|
|
479
|
-
# Install k9s in ~/.local/bin
|
|
480
|
-
# Expected args:
|
|
481
|
-
# 1. a writable folder where to write downloaded files
|
|
482
|
-
install_k9s() {
|
|
483
|
-
local DL_ROOT=$1
|
|
484
|
-
local DL_PATH="$DL_ROOT/k9s"
|
|
485
|
-
if [ ! -d "$DL_PATH" ]; then
|
|
486
|
-
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
487
|
-
curl -OLsS https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_amd64.tar.gz
|
|
488
|
-
curl -OLsS https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/checksums.sha256
|
|
489
|
-
sha256sum --ignore-missing --quiet -c checksums.sha256
|
|
490
|
-
cd ~-
|
|
491
|
-
fi
|
|
492
|
-
cd "$DL_PATH"
|
|
493
|
-
tar xf k9s_Linux_amd64.tar.gz
|
|
494
|
-
cp k9s ~/.local/bin
|
|
495
|
-
cd ~-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
447
|
# Install listed requirements
|
|
499
448
|
# Usage: install_reqs mongo7 nvm node16 yq
|
|
500
449
|
install_reqs() {
|
|
@@ -545,6 +494,61 @@ get_json_value() {
|
|
|
545
494
|
yq --output-format=yaml ".$JSON_FIELD" "$JSON_SRC"
|
|
546
495
|
}
|
|
547
496
|
|
|
497
|
+
# Extract version major from a version string.
|
|
498
|
+
# Expected args:
|
|
499
|
+
# 1. the version string
|
|
500
|
+
get_semver_major() {
|
|
501
|
+
local VERSION="$1"
|
|
502
|
+
local VERSION_REGEX="^([0-9]+)(\.[0-9]+)?(\.[0-9]+)?$"
|
|
503
|
+
if [[ "$VERSION" =~ $VERSION_REGEX ]]; then
|
|
504
|
+
printf "%s" "${BASH_REMATCH[1]}"
|
|
505
|
+
fi
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
# Extract version minor from a version string.
|
|
509
|
+
# Expected args:
|
|
510
|
+
# 1. the version string
|
|
511
|
+
get_semver_minor() {
|
|
512
|
+
local VERSION="$1"
|
|
513
|
+
local VERSION_REGEX="^[0-9]+\.([0-9]+)(\.[0-9]+)?$"
|
|
514
|
+
if [[ "$VERSION" =~ $VERSION_REGEX ]]; then
|
|
515
|
+
printf "%s" "${BASH_REMATCH[1]}"
|
|
516
|
+
fi
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
# Extract version minor from a version string.
|
|
520
|
+
# Expected args:
|
|
521
|
+
# 1. the version string
|
|
522
|
+
get_semver_patch() {
|
|
523
|
+
local VERSION="$1"
|
|
524
|
+
local VERSION_REGEX="^[0-9]+\.[0-9]+\.([0-9]+)$"
|
|
525
|
+
if [[ "$VERSION" =~ $VERSION_REGEX ]]; then
|
|
526
|
+
printf "%s" "${BASH_REMATCH[1]}"
|
|
527
|
+
fi
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
# Generates the markdown anchor corresponding to the given title taking
|
|
531
|
+
# markdown flavors into account.
|
|
532
|
+
# Expected args:
|
|
533
|
+
# 1. the section title
|
|
534
|
+
# 2. the markdown flavor (github, gitlab, ...)
|
|
535
|
+
normalize_markdown_anchor() {
|
|
536
|
+
local SECTION_TITLE="$1"
|
|
537
|
+
local MARKDOWN_FLAVOR="$2"
|
|
538
|
+
|
|
539
|
+
case "$MARKDOWN_FLAVOR" in
|
|
540
|
+
github)
|
|
541
|
+
echo "$SECTION_TITLE" | tr '/' '-'
|
|
542
|
+
;;
|
|
543
|
+
gitlab)
|
|
544
|
+
echo "$SECTION_TITLE" | tr -d '/'
|
|
545
|
+
;;
|
|
546
|
+
*)
|
|
547
|
+
echo "$SECTION_TITLE"
|
|
548
|
+
;;
|
|
549
|
+
esac
|
|
550
|
+
}
|
|
551
|
+
|
|
548
552
|
### Git
|
|
549
553
|
###
|
|
550
554
|
|
|
@@ -753,7 +757,7 @@ begin_group() {
|
|
|
753
757
|
echo "travis_fold:start:$TITLE"
|
|
754
758
|
fi
|
|
755
759
|
else
|
|
756
|
-
echo "%< --- $TITLE
|
|
760
|
+
echo -e "${KASH_TXT_BOLD}%< --- $TITLE ------${KASH_TXT_RESET}"
|
|
757
761
|
fi
|
|
758
762
|
}
|
|
759
763
|
|
|
@@ -773,7 +777,7 @@ end_group() {
|
|
|
773
777
|
echo "travis_fold:end:$TITLE"
|
|
774
778
|
fi
|
|
775
779
|
else
|
|
776
|
-
echo "------ $TITLE ---
|
|
780
|
+
echo -e "${KASH_TXT_BOLD}------ $TITLE --- >%${KASH_TXT_RESET}"
|
|
777
781
|
fi
|
|
778
782
|
}
|
|
779
783
|
|
|
@@ -957,28 +961,82 @@ load_value_files() {
|
|
|
957
961
|
### Kalisio
|
|
958
962
|
###
|
|
959
963
|
|
|
964
|
+
# Returns the kalisio flavor based on the git ref (tag or branch name).
|
|
965
|
+
# Known flavors are 'dev', 'test' and 'prod'.
|
|
966
|
+
# Expected args:
|
|
967
|
+
# 1. the git ref name
|
|
968
|
+
get_flavor_from_git_ref() {
|
|
969
|
+
local GIT_REF=$1
|
|
970
|
+
|
|
971
|
+
case "$GIT_REF" in
|
|
972
|
+
# Will match anything beginning with 'prod-'
|
|
973
|
+
prod-*)
|
|
974
|
+
printf "prod"
|
|
975
|
+
;;
|
|
976
|
+
# Will match single 'test' or anything beginning with 'test-'
|
|
977
|
+
test | test-*)
|
|
978
|
+
printf "test"
|
|
979
|
+
;;
|
|
980
|
+
# Anything else is 'dev' flavor
|
|
981
|
+
*)
|
|
982
|
+
printf "dev"
|
|
983
|
+
;;
|
|
984
|
+
esac
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
# Returns the kalisio version based on the git ref (tag or branch name).
|
|
988
|
+
# Version may be MAJOR.MINOR (eg. with 'test' flavors) or MAJOR.MINOR.PATCH (eg. with 'prod' flavors)
|
|
989
|
+
# Expected args:
|
|
990
|
+
# 1. the git ref name
|
|
991
|
+
get_version_from_git_ref() {
|
|
992
|
+
local GIT_REF=$1
|
|
993
|
+
|
|
994
|
+
local VERSION_REGEX="-v([0-9]+\.[0-9]+(\.[0-9]+)?)"
|
|
995
|
+
if [[ "$GIT_REF" =~ $VERSION_REGEX ]]; then
|
|
996
|
+
printf "%s" "${BASH_REMATCH[1]}"
|
|
997
|
+
fi
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
# Returns the kalisio custom field based on the git ref (tag or branch name).
|
|
1001
|
+
# Expected args:
|
|
1002
|
+
# 1. the git ref name
|
|
1003
|
+
get_custom_from_git_ref() {
|
|
1004
|
+
local GIT_REF=$1
|
|
1005
|
+
|
|
1006
|
+
local CUSTOM_REGEX="(^|-)([a-zA-Z0-9]+)$"
|
|
1007
|
+
if [[ "$GIT_REF" =~ $CUSTOM_REGEX ]]; then
|
|
1008
|
+
if [[ "${BASH_REMATCH[1]}" == "" ]]; then
|
|
1009
|
+
# If first capture group is empty => that's probably a 'dev' flavor.
|
|
1010
|
+
# The branch name = the custom field (except for master and main)
|
|
1011
|
+
#
|
|
1012
|
+
case "${BASH_REMATCH[2]}" in
|
|
1013
|
+
# Also exclude 'test' as it's a valid branch name for test flavor
|
|
1014
|
+
master | main | test)
|
|
1015
|
+
;;
|
|
1016
|
+
*)
|
|
1017
|
+
printf "%s" "${BASH_REMATCH[2]}"
|
|
1018
|
+
;;
|
|
1019
|
+
esac
|
|
1020
|
+
else
|
|
1021
|
+
# Otherwise, that's probably a test or prod flavor,
|
|
1022
|
+
printf "%s" "${BASH_REMATCH[2]}"
|
|
1023
|
+
fi
|
|
1024
|
+
fi
|
|
1025
|
+
}
|
|
1026
|
+
|
|
960
1027
|
# Returns the kalisio flavor (prod, test, dev) according to current branch/tag name
|
|
961
1028
|
# Expected args:
|
|
962
1029
|
# 1. the repository root folder
|
|
963
1030
|
get_flavor_from_git() {
|
|
964
1031
|
local REPO_DIR=$1
|
|
965
|
-
# Matches 'test' but also 'test-v1.2'
|
|
966
|
-
local TEST_FLAVOR_REGEX="^test(-v[0-9]+\.[0-9]+)?$"
|
|
967
|
-
# Only matches 'prod-v1.2.3'
|
|
968
|
-
local PROD_FLAVOR_REGEX="^prod-v[0-9]+\.[0-9]+\.[0-9]+$"
|
|
969
1032
|
|
|
970
1033
|
local GIT_TAG
|
|
971
1034
|
GIT_TAG=$(get_git_tag "$REPO_DIR")
|
|
972
1035
|
local GIT_BRANCH
|
|
973
1036
|
GIT_BRANCH=$(get_git_branch "$REPO_DIR")
|
|
1037
|
+
local GIT_REF="${GIT_TAG:-$GIT_BRANCH}"
|
|
974
1038
|
|
|
975
|
-
|
|
976
|
-
printf "prod"
|
|
977
|
-
elif [[ "$GIT_BRANCH" =~ $TEST_FLAVOR_REGEX ]]; then
|
|
978
|
-
printf "test"
|
|
979
|
-
else
|
|
980
|
-
printf "dev"
|
|
981
|
-
fi
|
|
1039
|
+
get_flavor_from_git_ref "$GIT_REF"
|
|
982
1040
|
}
|
|
983
1041
|
|
|
984
1042
|
# Returns the git ref that produced the given container tag.
|
|
@@ -1033,10 +1091,10 @@ run_kli() {
|
|
|
1033
1091
|
fi
|
|
1034
1092
|
|
|
1035
1093
|
cd "$WORK_DIR"
|
|
1036
|
-
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --clone --shallow-clone
|
|
1094
|
+
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --clone --shallow-clone --fail-on-error
|
|
1037
1095
|
if [ "$KLI_RUN" = klifull ]; then
|
|
1038
|
-
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --install
|
|
1039
|
-
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --link --link-folder "$WORK_DIR/yarn-links"
|
|
1096
|
+
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --install --fail-on-error
|
|
1097
|
+
nvm exec "$NODE_VERSION" node "$WORK_DIR/kli/index.js" "$KLI_FILE" --link --link-folder "$WORK_DIR/yarn-links" --fail-on-error
|
|
1040
1098
|
fi
|
|
1041
1099
|
cd ~-
|
|
1042
1100
|
}
|
|
@@ -1086,6 +1144,11 @@ setup_app_workspace() {
|
|
|
1086
1144
|
local DEVELOPMENT_DIR="$WORKSPACE_DIR/development"
|
|
1087
1145
|
git_shallow_clone "$DEVELOPMENT_REPO_URL" "$DEVELOPMENT_DIR"
|
|
1088
1146
|
|
|
1147
|
+
# NOTE: we don't reuse init_app_infos here since init_app_infos
|
|
1148
|
+
# fetch app version from package.json (it requires a cloned repo)
|
|
1149
|
+
# Here we might be setting up workspace for a specific
|
|
1150
|
+
# branch / tag that's not currently checked out.
|
|
1151
|
+
|
|
1089
1152
|
# fetch app name and ref (tag or branch) required
|
|
1090
1153
|
local APP_NAME
|
|
1091
1154
|
APP_NAME=$(yq --output-format=yaml '.name' "$REPO_DIR/package.json")
|
|
@@ -1101,26 +1164,20 @@ setup_app_workspace() {
|
|
|
1101
1164
|
GIT_REF="$7"
|
|
1102
1165
|
fi
|
|
1103
1166
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1167
|
+
local APP_FLAVOR
|
|
1168
|
+
APP_FLAVOR=$(get_flavor_from_git_ref "$GIT_REF")
|
|
1169
|
+
local APP_VERSION
|
|
1170
|
+
APP_VERSION=$(get_version_from_git_ref "$GIT_REF")
|
|
1171
|
+
local APP_CUSTOM
|
|
1172
|
+
APP_CUSTOM=$(get_custom_from_git_ref "$GIT_REF")
|
|
1109
1173
|
|
|
1110
1174
|
# determine associated kli file
|
|
1111
|
-
local KLI_FILE
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
KLI_FILE="$KLI_BASE/test/$APP_NAME-${BASH_REMATCH[1]}.js"
|
|
1118
|
-
else
|
|
1119
|
-
KLI_FILE="$KLI_BASE/dev/$APP_NAME-$GIT_REF.js"
|
|
1120
|
-
if [ ! -f "$KLI_FILE" ]; then
|
|
1121
|
-
KLI_FILE="$KLI_BASE/dev/$APP_NAME.js"
|
|
1122
|
-
fi
|
|
1123
|
-
fi
|
|
1175
|
+
local KLI_FILE="$DEVELOPMENT_DIR"
|
|
1176
|
+
[[ "$KLI_BASE" != "" ]] && KLI_FILE="$KLI_FILE/$KLI_BASE"
|
|
1177
|
+
KLI_FILE="$KLI_FILE/$APP_NAME/$APP_FLAVOR/$APP_NAME"
|
|
1178
|
+
[[ "$APP_VERSION" != "" ]] && KLI_FILE="$KLI_FILE-$APP_VERSION"
|
|
1179
|
+
[[ "$APP_CUSTOM" != "" ]] && KLI_FILE="$KLI_FILE-$APP_CUSTOM"
|
|
1180
|
+
KLI_FILE="$KLI_FILE.js"
|
|
1124
1181
|
|
|
1125
1182
|
# run kli !
|
|
1126
1183
|
if [ "$KLI_RUN" = kli ] || [ "$KLI_RUN" = klifull ]; then
|
|
@@ -1148,35 +1205,37 @@ init_app_infos() {
|
|
|
1148
1205
|
APP_NAME=$(yq --output-format=yaml '.name' "$REPO_ROOT/package.json")
|
|
1149
1206
|
local APP_VERSION
|
|
1150
1207
|
APP_VERSION=$(yq --output-format=yaml '.version' "$REPO_ROOT/package.json")
|
|
1151
|
-
|
|
1152
|
-
|
|
1208
|
+
local APP_VERSION_MAJOR
|
|
1209
|
+
local APP_VERSION_MINOR
|
|
1210
|
+
APP_VERSION_MAJOR=$(get_semver_major "$APP_VERSION")
|
|
1211
|
+
APP_VERSION_MINOR=$(get_semver_minor "$APP_VERSION")
|
|
1153
1212
|
|
|
1154
1213
|
local GIT_TAG
|
|
1155
1214
|
GIT_TAG=$(get_git_tag "$REPO_ROOT")
|
|
1156
1215
|
local GIT_BRANCH
|
|
1157
1216
|
GIT_BRANCH=$(get_git_branch "$REPO_ROOT")
|
|
1158
|
-
|
|
1159
1217
|
local GIT_REF="${GIT_TAG:-$GIT_BRANCH}"
|
|
1160
1218
|
|
|
1161
1219
|
local APP_FLAVOR
|
|
1162
|
-
|
|
1163
|
-
local
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1220
|
+
APP_FLAVOR=$(get_flavor_from_git_ref "$GIT_REF")
|
|
1221
|
+
local APP_CUSTOM
|
|
1222
|
+
APP_CUSTOM=$(get_custom_from_git_ref "$GIT_REF")
|
|
1223
|
+
|
|
1224
|
+
local KLI_FILE="$KLI_BASE/$APP_NAME/$APP_FLAVOR/$APP_NAME"
|
|
1225
|
+
case "$APP_FLAVOR" in
|
|
1226
|
+
prod)
|
|
1227
|
+
KLI_FILE="$KLI_FILE-$APP_VERSION"
|
|
1228
|
+
;;
|
|
1229
|
+
test)
|
|
1230
|
+
KLI_FILE="$KLI_FILE-$APP_VERSION_MAJOR.$APP_VERSION_MINOR"
|
|
1231
|
+
;;
|
|
1232
|
+
*)
|
|
1233
|
+
;;
|
|
1234
|
+
esac
|
|
1235
|
+
[[ "$APP_CUSTOM" != "" ]] && KLI_FILE="$KLI_FILE-$APP_CUSTOM"
|
|
1236
|
+
KLI_FILE="$KLI_FILE.js"
|
|
1178
1237
|
|
|
1179
|
-
APP_INFOS=("$APP_NAME" "$APP_VERSION" "$APP_FLAVOR" "$GIT_TAG" "$GIT_BRANCH" "$KLI_FILE")
|
|
1238
|
+
APP_INFOS=("$APP_NAME" "$APP_VERSION" "$APP_FLAVOR" "$APP_CUSTOM" "$GIT_TAG" "$GIT_BRANCH" "$KLI_FILE")
|
|
1180
1239
|
}
|
|
1181
1240
|
|
|
1182
1241
|
# Extract app name from app infos
|
|
@@ -1197,22 +1256,28 @@ get_app_flavor() {
|
|
|
1197
1256
|
echo "${APP_INFOS[2]}"
|
|
1198
1257
|
}
|
|
1199
1258
|
|
|
1259
|
+
# Extract app flavor from app infos
|
|
1260
|
+
# NOTE: requires a call to init_app_infos first
|
|
1261
|
+
get_app_custom() {
|
|
1262
|
+
echo "${APP_INFOS[3]}"
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1200
1265
|
# Extract app tag from app infos
|
|
1201
1266
|
# NOTE: requires a call to init_app_infos first
|
|
1202
1267
|
get_app_tag() {
|
|
1203
|
-
echo "${APP_INFOS[
|
|
1268
|
+
echo "${APP_INFOS[4]}"
|
|
1204
1269
|
}
|
|
1205
1270
|
|
|
1206
1271
|
# Extract app branch from app infos
|
|
1207
1272
|
# NOTE: requires a call to init_app_infos first
|
|
1208
1273
|
get_app_branch() {
|
|
1209
|
-
echo "${APP_INFOS[
|
|
1274
|
+
echo "${APP_INFOS[5]}"
|
|
1210
1275
|
}
|
|
1211
1276
|
|
|
1212
1277
|
# Extract app kli file from app infos
|
|
1213
1278
|
# NOTE: requires a call to init_app_infos first
|
|
1214
1279
|
get_app_kli_file() {
|
|
1215
|
-
echo "${APP_INFOS[
|
|
1280
|
+
echo "${APP_INFOS[6]}"
|
|
1216
1281
|
}
|
|
1217
1282
|
|
|
1218
1283
|
# Run backend tests for the given app.
|
|
@@ -1257,15 +1322,19 @@ run_app_tests() {
|
|
|
1257
1322
|
## Run tests
|
|
1258
1323
|
##
|
|
1259
1324
|
|
|
1325
|
+
pushd "$REPO_DIR/api"
|
|
1326
|
+
|
|
1260
1327
|
use_node "$NODE_VER"
|
|
1261
|
-
yarn test
|
|
1328
|
+
yarn test
|
|
1262
1329
|
|
|
1263
1330
|
## Publish code coverage
|
|
1264
1331
|
##
|
|
1265
1332
|
|
|
1266
1333
|
if [ "$CODE_COVERAGE" = true ]; then
|
|
1267
|
-
send_coverage_to_cc "$CC_TEST_REPORTER_ID"
|
|
1334
|
+
send_coverage_to_cc "$CC_TEST_REPORTER_ID" "api"
|
|
1268
1335
|
fi
|
|
1336
|
+
|
|
1337
|
+
popd
|
|
1269
1338
|
}
|
|
1270
1339
|
|
|
1271
1340
|
# Setup the workspace for a lib project.
|
|
@@ -1527,9 +1596,6 @@ build_docs () {
|
|
|
1527
1596
|
|
|
1528
1597
|
begin_group "Building docs for $REPOSITORY ..."
|
|
1529
1598
|
|
|
1530
|
-
# Build process requires node 18
|
|
1531
|
-
use_node 18
|
|
1532
|
-
|
|
1533
1599
|
rm -f .postcssrc.js && cd docs && yarn install && yarn build
|
|
1534
1600
|
|
|
1535
1601
|
if [ "$PUBLISH" = true ]; then
|
|
@@ -1553,107 +1619,360 @@ build_docs () {
|
|
|
1553
1619
|
end_group "Building docs for $REPOSITORY ..."
|
|
1554
1620
|
}
|
|
1555
1621
|
|
|
1556
|
-
|
|
1622
|
+
### e2e tests
|
|
1623
|
+
###
|
|
1624
|
+
|
|
1625
|
+
# Build the e2e tests container
|
|
1557
1626
|
# Expected arguments
|
|
1558
|
-
# 1.
|
|
1559
|
-
# 2
|
|
1627
|
+
# 1. the app root directory
|
|
1628
|
+
# 2. the subdomain where the app is deployed
|
|
1629
|
+
# 3: true to publish built container on a registry
|
|
1630
|
+
# 4. the registry url, eg. "docker.io"
|
|
1631
|
+
# 5. the username to login the registry
|
|
1632
|
+
# 6. a file where the password is stored in cleartext
|
|
1633
|
+
# 7. the name to give to the built container image
|
|
1634
|
+
# 8. the tag to give to the built container image
|
|
1560
1635
|
build_e2e_tests () {
|
|
1561
1636
|
local ROOT_DIR="$1"
|
|
1562
|
-
local
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1637
|
+
local SUBDOMAIN="$2"
|
|
1638
|
+
local PUBLISH="$3"
|
|
1639
|
+
local REGISTRY_URL="$4"
|
|
1640
|
+
local REGISTRY_USERNAME="$5"
|
|
1641
|
+
local REGISTRY_PASSWORD_FILE="$6"
|
|
1642
|
+
local IMAGE_NAME="$7"
|
|
1643
|
+
local IMAGE_TAG="$8"
|
|
1566
1644
|
|
|
1567
1645
|
local WORKSPACE_DIR
|
|
1568
1646
|
WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
|
|
1569
|
-
|
|
1647
|
+
# NOTE: KLI_BASE parameter is irrelevant, we don't use kli so just leave it empty
|
|
1648
|
+
init_app_infos "$ROOT_DIR" ""
|
|
1570
1649
|
|
|
1571
1650
|
local APP
|
|
1572
1651
|
APP=$(get_app_name)
|
|
1573
|
-
local VERSION
|
|
1574
|
-
VERSION=$(get_app_version)
|
|
1652
|
+
# local VERSION
|
|
1653
|
+
# VERSION=$(get_app_version)
|
|
1575
1654
|
local FLAVOR
|
|
1576
1655
|
FLAVOR=$(get_app_flavor)
|
|
1577
1656
|
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
load_env_files "$WORKSPACE_DIR/development/common/kalisio_harbor.enc.env"
|
|
1581
|
-
load_value_files "$WORKSPACE_DIR/development/common/KALISIO_HARBOR_PASSWORD.enc.value"
|
|
1582
|
-
|
|
1583
|
-
## Build container
|
|
1584
|
-
##
|
|
1585
|
-
|
|
1586
|
-
local IMAGE_NAME="$KALISIO_HARBOR_URL/kalisio/$APP-e2e-tests"
|
|
1587
|
-
local IMAGE_TAG="$VERSION-$FLAVOR"
|
|
1588
|
-
|
|
1589
|
-
begin_group "Building container ..."
|
|
1657
|
+
begin_group "Building $REGISTRY_URL/$IMAGE_NAME:$IMAGE_TAG ..."
|
|
1590
1658
|
|
|
1591
|
-
docker login --username "$
|
|
1659
|
+
docker login --username "$REGISTRY_USERNAME" --password-stdin "$REGISTRY_URL" < "$REGISTRY_PASSWORD_FILE"
|
|
1592
1660
|
# DOCKER_BUILDKIT is here to be able to use Dockerfile specific dockerginore (e2e-tests.Dockerfile.dockerignore)
|
|
1593
1661
|
DOCKER_BUILDKIT=1 docker build \
|
|
1594
1662
|
--build-arg APP="$APP" \
|
|
1595
1663
|
--build-arg NODE_APP_INSTANCE="$FLAVOR" \
|
|
1596
|
-
--build-arg SUBDOMAIN="$
|
|
1597
|
-
--build-arg HEADLESS=true \
|
|
1664
|
+
--build-arg SUBDOMAIN="$SUBDOMAIN" \
|
|
1598
1665
|
-f "$ROOT_DIR/e2e-tests.Dockerfile" \
|
|
1599
|
-
-t "$IMAGE_NAME:$IMAGE_TAG" \
|
|
1666
|
+
-t "$REGISTRY_URL/$IMAGE_NAME:$IMAGE_TAG" \
|
|
1600
1667
|
"$WORKSPACE_DIR"
|
|
1601
|
-
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$FLAVOR"
|
|
1668
|
+
docker tag "$REGISTRY_URL/$IMAGE_NAME:$IMAGE_TAG" "$REGISTRY_URL/$IMAGE_NAME:$FLAVOR"
|
|
1602
1669
|
|
|
1603
1670
|
if [ "$PUBLISH" = true ]; then
|
|
1604
|
-
docker push "$IMAGE_NAME:$IMAGE_TAG"
|
|
1605
|
-
docker push "$IMAGE_NAME:$FLAVOR"
|
|
1671
|
+
docker push "$REGISTRY_URL/$IMAGE_NAME:$IMAGE_TAG"
|
|
1672
|
+
docker push "$REGISTRY_URL/$IMAGE_NAME:$FLAVOR"
|
|
1606
1673
|
fi
|
|
1607
1674
|
|
|
1608
|
-
docker logout "$
|
|
1675
|
+
docker logout "$REGISTRY_URL"
|
|
1609
1676
|
|
|
1610
|
-
end_group "Building
|
|
1677
|
+
end_group "Building $REGISTRY_URL/$IMAGE_NAME:$IMAGE_TAG ..."
|
|
1611
1678
|
}
|
|
1612
1679
|
|
|
1613
1680
|
# Run e2e tests
|
|
1614
|
-
# Specific error handling: set -uo pipefail to bypass errors
|
|
1615
1681
|
# Expected arguments
|
|
1616
|
-
# 1.
|
|
1682
|
+
# 1. the app root directory
|
|
1617
1683
|
# 2: the app name
|
|
1618
|
-
# 3: the slack webhook apps
|
|
1619
1684
|
run_e2e_tests () {
|
|
1620
1685
|
local ROOT_DIR="$1"
|
|
1621
1686
|
local APP="$2"
|
|
1622
|
-
local
|
|
1623
|
-
|
|
1624
|
-
## Run tests & redirect output to a log file
|
|
1625
|
-
##
|
|
1687
|
+
local TESTS_RESULTS="$ROOT_DIR/test/run/chrome"
|
|
1626
1688
|
|
|
1627
1689
|
# Chrome
|
|
1628
|
-
mkdir -p "$
|
|
1629
|
-
yarn test:client
|
|
1630
|
-
local
|
|
1690
|
+
mkdir -p "$TESTS_RESULTS"
|
|
1691
|
+
yarn test:client 2>&1 | tee "$TESTS_RESULTS/logs.txt"
|
|
1692
|
+
local RET="${PIPESTATUS[0]}"
|
|
1631
1693
|
|
|
1632
1694
|
# Firefox
|
|
1633
1695
|
# PUPPETEER_PRODUCT=firefox yarn add puppeteer
|
|
1634
1696
|
# yarn link "@kalisio/kdk" --link-folder /opt/kalisio/yarn-links
|
|
1635
1697
|
# export BROWSER="firefox"bucket
|
|
1636
1698
|
# mkdir -p "$ROOT_DIR/test/run/firefox"
|
|
1637
|
-
|
|
1699
|
+
return "$RET" # return the exit code of the tests (= number of failed tests)
|
|
1700
|
+
}
|
|
1638
1701
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1702
|
+
# Upload e2e tests artefacts to some s3 storage.
|
|
1703
|
+
# Expected args:
|
|
1704
|
+
# 1. the app root dir
|
|
1705
|
+
# 2. the app name
|
|
1706
|
+
# 3. the number of failed tests
|
|
1707
|
+
# 4. the s3 bucket where to upload artefacts (with a rclone remote, like ovh:e2e-test/blabla)
|
|
1708
|
+
# 5. the rclone.conf file to use to upload artefacts
|
|
1709
|
+
# 6. the file where the upload report will be written (json)
|
|
1710
|
+
upload_e2e_tests_artefacts() {
|
|
1711
|
+
local ROOT_DIR="$1"
|
|
1712
|
+
local APP="$2"
|
|
1713
|
+
local NUM_FAILED="$3"
|
|
1714
|
+
local S3_BUCKET="$4"
|
|
1715
|
+
local RCLONE_CONF="$5"
|
|
1716
|
+
local UPLOAD_REPORT_FILE="$6"
|
|
1717
|
+
|
|
1718
|
+
local TIMESTAMP
|
|
1719
|
+
TIMESTAMP="$(date +"%d-%m-%Y")"
|
|
1720
|
+
local TESTS_RESULTS_DIR="$ROOT_DIR/test/run/chrome"
|
|
1721
|
+
local WORK_DIR="$TMP_DIR/artefacts/$APP/$TIMESTAMP/e2e"
|
|
1722
|
+
local REMOTE_DIR="$S3_BUCKET/$APP/$TIMESTAMP/e2e"
|
|
1723
|
+
|
|
1724
|
+
mkdir -p "$WORK_DIR"
|
|
1725
|
+
|
|
1726
|
+
# zip the whole tests results folder
|
|
1727
|
+
local ZIP_FILE="$WORK_DIR/e2e-artefacts.zip"
|
|
1728
|
+
cd "$TESTS_RESULTS_DIR"
|
|
1729
|
+
zip -r "$ZIP_FILE" .
|
|
1730
|
+
cd ~-
|
|
1641
1731
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
local CHROME_LOGS_LINK=""
|
|
1645
|
-
local SCREEN_LINK=""
|
|
1732
|
+
# keep log file as is
|
|
1733
|
+
cp "$TESTS_RESULTS_DIR/logs.txt" "$WORK_DIR/logs.txt"
|
|
1646
1734
|
|
|
1647
|
-
|
|
1735
|
+
# and keep captures and diffs for failed tests
|
|
1736
|
+
local TESTS_WITH_DIFF=()
|
|
1737
|
+
readarray -d '' DIFF_FILES < <(find "$TESTS_RESULTS_DIR" -type f -name 'diff.*.png' -print0)
|
|
1738
|
+
for DIFF_FILE in "${DIFF_FILES[@]}"; do
|
|
1739
|
+
local BASE_DIFF_FILE
|
|
1740
|
+
BASE_DIFF_FILE="$(basename "$DIFF_FILE")"
|
|
1741
|
+
local BASE_CAPTURE_FILE="${BASE_DIFF_FILE#diff.*}"
|
|
1742
|
+
local CAPTURE_FILE
|
|
1743
|
+
CAPTURE_FILE="$(dirname "$DIFF_FILE")/$BASE_CAPTURE_FILE"
|
|
1648
1744
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1745
|
+
local TEST_DIR
|
|
1746
|
+
TEST_DIR="$(realpath -s --relative-to="$TESTS_RESULTS_DIR" "$DIFF_FILE")"
|
|
1747
|
+
TEST_DIR="$(dirname "$TEST_DIR")"
|
|
1748
|
+
TEST_DIR="$(dirname "$TEST_DIR")"
|
|
1651
1749
|
|
|
1652
|
-
|
|
1653
|
-
|
|
1750
|
+
local TEST_NAME
|
|
1751
|
+
TEST_NAME="$TEST_DIR/${BASE_CAPTURE_FILE%.*}"
|
|
1654
1752
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1753
|
+
TESTS_WITH_DIFF+=("$TEST_NAME")
|
|
1754
|
+
|
|
1755
|
+
mkdir -p "$WORK_DIR/$TEST_DIR"
|
|
1756
|
+
cp "$DIFF_FILE" "$WORK_DIR/$TEST_DIR"
|
|
1757
|
+
cp "$CAPTURE_FILE" "$WORK_DIR/$TEST_DIR"
|
|
1758
|
+
done
|
|
1759
|
+
|
|
1760
|
+
rclone --config "$RCLONE_CONF" copy "$TMP_DIR/artefacts" "$S3_BUCKET"
|
|
1761
|
+
|
|
1762
|
+
rm -fR "$WORK_DIR"
|
|
1763
|
+
|
|
1764
|
+
# now generate public http links
|
|
1765
|
+
local ARTEFACTS_LINK
|
|
1766
|
+
ARTEFACTS_LINK="$(rclone --config "$RCLONE_CONF" link "$REMOTE_DIR/e2e-artefacts.zip")"
|
|
1767
|
+
local LOGS_LINK
|
|
1768
|
+
LOGS_LINK="$(rclone --config "$RCLONE_CONF" link "$REMOTE_DIR/logs.txt")"
|
|
1769
|
+
|
|
1770
|
+
printf '{ "app": "%s", "timestamp": "%s", "num_failed": "%d", "artefacts": "%s", "logs": "%s", "num_diffs": "%d", "diffs": [' "$APP" "$TIMESTAMP" "$NUM_FAILED" "$ARTEFACTS_LINK" "$LOGS_LINK" "${#TESTS_WITH_DIFF[@]}" > "$UPLOAD_REPORT_FILE"
|
|
1771
|
+
|
|
1772
|
+
local COMMA=""
|
|
1773
|
+
for TEST_NAME in "${TESTS_WITH_DIFF[@]}"; do
|
|
1774
|
+
local CAPTURE_LINK
|
|
1775
|
+
CAPTURE_LINK="$(rclone --config "$RCLONE_CONF" link "$REMOTE_DIR/$TEST_NAME.png")"
|
|
1776
|
+
local DIFF_FILE
|
|
1777
|
+
DIFF_FILE="$(dirname "$TEST_NAME")/diff.$(basename "$TEST_NAME").png"
|
|
1778
|
+
local DIFF_LINK
|
|
1779
|
+
DIFF_LINK="$(rclone --config "$RCLONE_CONF" link "$REMOTE_DIR/$DIFF_FILE")"
|
|
1780
|
+
printf '%s { "name": "%s", "capture": "%s", "diff": "%s" }' "$COMMA" "$TEST_NAME" "$CAPTURE_LINK" "$DIFF_LINK" >> "$UPLOAD_REPORT_FILE"
|
|
1781
|
+
COMMA=","
|
|
1782
|
+
done
|
|
1783
|
+
|
|
1784
|
+
printf " ] }" >> "$UPLOAD_REPORT_FILE"
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
# Generates a markdown report file from the upload report file
|
|
1788
|
+
# generated by the upload_e2e_tests_artefacts function.
|
|
1789
|
+
# Expected args:
|
|
1790
|
+
# 1. the same upload report file used in upload_e2e_tests_artefacts
|
|
1791
|
+
# 2. the file where to write the markdown report
|
|
1792
|
+
# 3. the flavor to use for the markdown (see normalize_markdown_anchor)
|
|
1793
|
+
generate_e2e_tests_markdown_report() {
|
|
1794
|
+
local UPLOAD_REPORT_FILE="$1"
|
|
1795
|
+
local MD_REPORT_FILE="$2"
|
|
1796
|
+
local MD_FLAVOR="$3"
|
|
1797
|
+
|
|
1798
|
+
local APP
|
|
1799
|
+
APP=$(get_json_value "$UPLOAD_REPORT_FILE" "app")
|
|
1800
|
+
local TIMESTAMP
|
|
1801
|
+
TIMESTAMP=$(get_json_value "$UPLOAD_REPORT_FILE" "timestamp")
|
|
1802
|
+
local NUM_FAILED
|
|
1803
|
+
NUM_FAILED=$(get_json_value "$UPLOAD_REPORT_FILE" "num_failed")
|
|
1804
|
+
local ARTEFACTS_LINK
|
|
1805
|
+
ARTEFACTS_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "artefacts")
|
|
1806
|
+
local LOGS_LINK
|
|
1807
|
+
LOGS_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "logs")
|
|
1808
|
+
local NUM_DIFFS
|
|
1809
|
+
NUM_DIFFS=$(get_json_value "$UPLOAD_REPORT_FILE" "num_diffs")
|
|
1810
|
+
|
|
1811
|
+
printf "# [%s] (e2e run from %s)\n\n" "$(echo "$APP" | tr '[:lower:]' '[:upper:]')" "$TIMESTAMP" > "$MD_REPORT_FILE"
|
|
1812
|
+
printf "[All artefacts](%s), [logs](%s)\n\n" "$ARTEFACTS_LINK" "$LOGS_LINK" >> "$MD_REPORT_FILE"
|
|
1813
|
+
|
|
1814
|
+
if (( NUM_FAILED == 0 )); then
|
|
1815
|
+
printf "> [!TIP]\n> All tests have passed\n" >> "$MD_REPORT_FILE"
|
|
1816
|
+
else
|
|
1817
|
+
printf "> [!CAUTION]\n> **%d** tests have failed\n" "$NUM_FAILED" >> "$MD_REPORT_FILE"
|
|
1818
|
+
|
|
1819
|
+
local SECTIONS=()
|
|
1820
|
+
for (( i = 0; i < NUM_DIFFS; ++i )); do
|
|
1821
|
+
local TEST_NAME
|
|
1822
|
+
TEST_NAME=$(get_json_value "$UPLOAD_REPORT_FILE" "diffs[$i].name")
|
|
1823
|
+
printf "> - [%s](#%s)\n" "$TEST_NAME" "$(normalize_markdown_anchor "$TEST_NAME" "$MD_FLAVOR")" >> "$MD_REPORT_FILE"
|
|
1824
|
+
|
|
1825
|
+
local CAPTURE_LINK
|
|
1826
|
+
CAPTURE_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "diffs[$i].capture")
|
|
1827
|
+
local DIFF_LINK
|
|
1828
|
+
DIFF_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "diffs[$i].diff")
|
|
1829
|
+
|
|
1830
|
+
read -r -d '' SECTION <<EOF
|
|
1831
|
+
## $TEST_NAME
|
|
1832
|
+
Captured file | Diff file
|
|
1833
|
+
--------------|----------
|
|
1834
|
+
 | 
|
|
1835
|
+
|
|
1836
|
+
EOF
|
|
1837
|
+
|
|
1838
|
+
SECTIONS+=("$SECTION")
|
|
1839
|
+
done
|
|
1840
|
+
|
|
1841
|
+
printf "\n" >> "$MD_REPORT_FILE"
|
|
1842
|
+
|
|
1843
|
+
for SECTION in "${SECTIONS[@]}"; do
|
|
1844
|
+
printf "%s\n" "$SECTION" >> "$MD_REPORT_FILE"
|
|
1845
|
+
done
|
|
1846
|
+
fi
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
# Add and commit the e2e tests report in a git repository.
|
|
1850
|
+
# Expected args:
|
|
1851
|
+
# 1. the same upload report file as upload_e2e_tests_artefacts
|
|
1852
|
+
# 2. the report file to add to the repo
|
|
1853
|
+
# 3. the repository url to use to clone and push (must be able to push!)
|
|
1854
|
+
# 4. a folder in which the report will be moved
|
|
1855
|
+
push_e2e_tests_report_to_git_repo() {
|
|
1856
|
+
local UPLOAD_FILE="$1"
|
|
1857
|
+
local REPORT_FILE="$2"
|
|
1858
|
+
local REPOSITORY_URL="$3"
|
|
1859
|
+
local REPORTS_BASE="$4"
|
|
1860
|
+
|
|
1861
|
+
local APP
|
|
1862
|
+
APP=$(get_json_value "$UPLOAD_FILE" "app")
|
|
1863
|
+
local TIMESTAMP
|
|
1864
|
+
TIMESTAMP=$(get_json_value "$UPLOAD_FILE" "timestamp")
|
|
1865
|
+
|
|
1866
|
+
local WORK_DIR
|
|
1867
|
+
WORK_DIR="$(mktemp -d -p "$TMP_DIR" push.XXXXXX)"
|
|
1868
|
+
|
|
1869
|
+
# Clone repo to a temp location
|
|
1870
|
+
git clone --depth 1 "$REPOSITORY_URL" "$WORK_DIR"
|
|
1871
|
+
# Copy report
|
|
1872
|
+
local REPORT_DIR="$WORK_DIR"
|
|
1873
|
+
[[ "$REPORTS_BASE" != "" ]] && REPORT_DIR="$REPORT_DIR/$REPORTS_BASE"
|
|
1874
|
+
REPORT_DIR="$REPORT_DIR/$APP/$TIMESTAMP"
|
|
1875
|
+
mkdir -p "$REPORT_DIR"
|
|
1876
|
+
|
|
1877
|
+
cp "$REPORT_FILE" "$REPORT_DIR"
|
|
1878
|
+
|
|
1879
|
+
# Try add link to 'latest' section
|
|
1880
|
+
local LATEST_REPORT
|
|
1881
|
+
LATEST_REPORT="$(realpath --relative-to="$WORK_DIR" "$REPORT_DIR")/$(basename "$REPORT_FILE")"
|
|
1882
|
+
|
|
1883
|
+
sed -i 's#^\['"$APP"' e2e\](.*)$#\['"$APP"' e2e\]('"${LATEST_REPORT//./\\.}"')#' "$WORK_DIR/README.md"
|
|
1884
|
+
|
|
1885
|
+
cd "$WORK_DIR"
|
|
1886
|
+
git add --all
|
|
1887
|
+
git -c user.name="CI bot" -c user.email="cibot@kalisio.com" commit --message "ci: e2e tests report from $TIMESTAMP"
|
|
1888
|
+
git push origin
|
|
1889
|
+
cd ~-
|
|
1890
|
+
|
|
1891
|
+
rm -fR "$WORK_DIR"
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
# Send the e2e tests report to a slack channel.
|
|
1895
|
+
# Expected args:
|
|
1896
|
+
# 1. the same upload report file as upload_e2e_tests_artefacts
|
|
1897
|
+
# 2. the slack channel webhook
|
|
1898
|
+
push_e2e_tests_report_to_slack() {
|
|
1899
|
+
local UPLOAD_REPORT_FILE="$1"
|
|
1900
|
+
local SLACK_WEBHOOK="$2"
|
|
1901
|
+
|
|
1902
|
+
local APP
|
|
1903
|
+
APP=$(get_json_value "$UPLOAD_REPORT_FILE" "app")
|
|
1904
|
+
local NUM_FAILED
|
|
1905
|
+
NUM_FAILED=$(get_json_value "$UPLOAD_REPORT_FILE" "num_failed")
|
|
1906
|
+
local ARTEFACTS_LINK
|
|
1907
|
+
ARTEFACTS_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "artefacts")
|
|
1908
|
+
local LOGS_LINK
|
|
1909
|
+
LOGS_LINK=$(get_json_value "$UPLOAD_REPORT_FILE" "logs")
|
|
1910
|
+
|
|
1911
|
+
slack_e2e_report "$APP" "$NUM_FAILED" "$SLACK_WEBHOOK" "$LOGS_LINK" "$ARTEFACTS_LINK"
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
# Take all steps to run e2e test and push results to a git repository. Binary artefacts
|
|
1915
|
+
# are uploaded on an s3 bucket.
|
|
1916
|
+
# Expected args:
|
|
1917
|
+
# 1. the app root dir
|
|
1918
|
+
# 2. the app name
|
|
1919
|
+
# 3. the s3 bucket where to upload binary artefacts
|
|
1920
|
+
# 4. the rclone.conf file to use with rclone
|
|
1921
|
+
# 5. the git repository url where we'll push the final report (must be able to push!)
|
|
1922
|
+
# 6. a folder in which the report will be moved
|
|
1923
|
+
run_and_publish_e2e_tests_to_git_repo() {
|
|
1924
|
+
local ROOT_DIR="$1"
|
|
1925
|
+
local APP="$2"
|
|
1926
|
+
local S3_BUCKET="$3"
|
|
1927
|
+
local RCLONE_CONF="$4"
|
|
1928
|
+
local REPOSITORY_URL="$5"
|
|
1929
|
+
local REPORTS_BASE="$6"
|
|
1930
|
+
|
|
1931
|
+
run_e2e_tests "$ROOT_DIR" "$APP"
|
|
1932
|
+
local NUM_FAILED="$?"
|
|
1933
|
+
|
|
1934
|
+
local MD_FLAVOR
|
|
1935
|
+
[[ "$REPOSITORY_URL" = *gitlab* ]] && MD_FLAVOR="gitlab"
|
|
1936
|
+
[[ "$REPOSITORY_URL" = *github* ]] && MD_FLAVOR="github"
|
|
1937
|
+
|
|
1938
|
+
local UPLOAD_REPORT_FILE="$TMP_DIR/e2e-upload-report.json"
|
|
1939
|
+
local MD_REPORT_FILE="$TMP_DIR/e2e.md"
|
|
1940
|
+
|
|
1941
|
+
upload_e2e_tests_artefacts \
|
|
1942
|
+
"$ROOT_DIR" "$APP" "$NUM_FAILED" \
|
|
1943
|
+
"$S3_BUCKET" "$RCLONE_CONF" \
|
|
1944
|
+
"$UPLOAD_REPORT_FILE"
|
|
1945
|
+
generate_e2e_tests_markdown_report \
|
|
1946
|
+
"$UPLOAD_REPORT_FILE" "$MD_REPORT_FILE" "$MD_FLAVOR"
|
|
1947
|
+
push_e2e_tests_report_to_git_repo \
|
|
1948
|
+
"$UPLOAD_REPORT_FILE" "$MD_REPORT_FILE" \
|
|
1949
|
+
"$REPOSITORY_URL" "$REPORTS_BASE"
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
# Take all steps to run e2e test and push results to a slack channel. Binary artefacts
|
|
1953
|
+
# are uploaded on an s3 bucket.
|
|
1954
|
+
# Expected args:
|
|
1955
|
+
# 1. the app root dir
|
|
1956
|
+
# 2. the app name
|
|
1957
|
+
# 3. the s3 bucket where to upload binary artefacts
|
|
1958
|
+
# 4. the rclone.conf file to use with rclone
|
|
1959
|
+
# 5. the slack channel webhook
|
|
1960
|
+
run_and_publish_e2e_tests_to_slack() {
|
|
1961
|
+
local ROOT_DIR="$1"
|
|
1962
|
+
local APP="$2"
|
|
1963
|
+
local S3_BUCKET="$3"
|
|
1964
|
+
local RCLONE_CONF="$4"
|
|
1965
|
+
local SLACK_WEBHOOK="$5"
|
|
1966
|
+
|
|
1967
|
+
run_e2e_tests "$ROOT_DIR" "$APP"
|
|
1968
|
+
local NUM_FAILED="$?"
|
|
1969
|
+
|
|
1970
|
+
local UPLOAD_REPORT_FILE="$TMP_DIR/e2e-upload-report.json"
|
|
1657
1971
|
|
|
1658
|
-
|
|
1972
|
+
upload_e2e_tests_artefacts \
|
|
1973
|
+
"$ROOT_DIR" "$APP" "$NUM_FAILED" \
|
|
1974
|
+
"$S3_BUCKET" "$RCLONE_CONF" \
|
|
1975
|
+
"$UPLOAD_REPORT_FILE"
|
|
1976
|
+
push_e2e_tests_report_to_slack \
|
|
1977
|
+
"$UPLOAD_REPORT_FILE" "$SLACK_WEBHOOK"
|
|
1659
1978
|
}
|