Skip to content

Commit

Permalink
Merge pull request #280 from DSD-DBS/provisioning-prerequisites
Browse files Browse the repository at this point in the history
feat: Load `ModelsImporter` dropin automatically
  • Loading branch information
MoritzWeber0 authored Apr 26, 2024
2 parents 3049130 + f3cd697 commit 72e213e
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 86 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
- '6.1.0'
dropins:
- name: 'without' # without dropins
dropins: ''
dropins: 'ModelsImporter'
- name: 'selected'
dropins: 'CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition' # selected set of dropins
dropins: 'ModelsImporter,CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition' # selected set of dropins
name:
Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }}
dropins
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ AUTOSTART_CAPELLA ?= 1

# Comma-separated list of dropins to download & add, doesn't affect copied & mounted dropins
# See available options in documentation: https://dsd-dbs.github.io/capella-dockerimages/capella/base/#optional-customisation-of-the-capella-client
CAPELLA_DROPINS ?= CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition,TextualEditor
CAPELLA_DROPINS ?= ModelsImporter,CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition,TextualEditor

# Only use when "capella_loop.sh" is NOT used
export DOCKER_TAG_SCHEMA ?= $$CAPELLA_VERSION-$$CAPELLA_DOCKERIMAGES_REVISION
Expand Down Expand Up @@ -144,6 +144,7 @@ RUN_TESTS_WITH_T4C_SERVER ?= 0
# correct locations (as described in the README)
RUN_TESTS_WITH_T4C_CLIENT ?= 0

CREATE_ENV_FILE:=$(shell touch .env)
include .env

export DOCKER_BUILDKIT=1
Expand Down
19 changes: 18 additions & 1 deletion capella/install_dropins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pathlib
import subprocess
import typing as t
import urllib.request

import yaml

Expand All @@ -27,7 +28,17 @@ def extract_repositories_and_install_ius(dropins: dict[str, t.Any]) -> None:

dropin = dropins[dropin_slug]

install_update_sites(dropin["eclipseRepository"], dropin["installIU"])
match dropin["type"]:
case "updateSite":
install_update_sites(
dropin["eclipseRepository"], dropin["installIU"]
)
case "dropin":
download_and_copy_dropin(
dropin["downloadURL"], dropin["fileName"]
)
case _:
raise ValueError(f"Unknown plugin type '{dropin['type']}'.")


def install_update_sites(repository: str, install_ui: list[str]) -> None:
Expand All @@ -47,6 +58,12 @@ def install_update_sites(repository: str, install_ui: list[str]) -> None:
)


def download_and_copy_dropin(download_url: str, file_name: str) -> None:
urllib.request.urlretrieve(
download_url, pathlib.Path("/opt/capella/dropins") / file_name
)


if __name__ == "__main__":
loaded_dropins = load_dropins()
extract_repositories_and_install_ius(loaded_dropins)
54 changes: 33 additions & 21 deletions capella/versions/5.0.0/dropins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@

dropins:
CapellaXHTMLDocGen:
github: "https://github.com/eclipse/capella-xhtml-docgen"
eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.0.0/"
github: 'https://github.com/eclipse/capella-xhtml-docgen'
type: updateSite
eclipseRepository: 'https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.0.0/'
installIU:
- "org.polarsys.capella.docgen.package.feature.feature.group"
- 'org.polarsys.capella.docgen.package.feature.feature.group'
DiagramStyler:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/'
installIU:
- "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group"
- 'com.thalesgroup.mde.capella.diagramstyler.feature.feature.group'
PVMT:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/'
installIU:
- "com.thalesgroup.vpd.property.feature.feature.group"
- 'com.thalesgroup.vpd.property.feature.feature.group'
Filtering:
github: "https://github.com/eclipse/capella-filtering"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.1/Filtering-updateSite-1.5.1.202104270742.zip!/"
github: 'https://github.com/eclipse/capella-filtering'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.1/Filtering-updateSite-1.5.1.202104270742.zip!/'
installIU:
- "org.polarsys.capella.filtering.feature.feature.group"
- 'org.polarsys.capella.filtering.feature.feature.group'
Requirements:
github: "https://github.com/eclipse/capella-requirements-vp"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/"
github: 'https://github.com/eclipse/capella-requirements-vp'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/'
installIU:
- "org.polarsys.capella.vp.requirements.feature.feature.group"
- 'org.polarsys.capella.vp.requirements.feature.feature.group'
SubsystemTransition:
github: "https://github.com/eclipse/capella-sss-transition"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/"
github: 'https://github.com/eclipse/capella-sss-transition'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/'
installIU:
- "org.polarsys.capella.transition.system2subsystem.feature.feature.group"
- 'org.polarsys.capella.transition.system2subsystem.feature.feature.group'
TextualEditor:
github: "https://github.com/eclipse/capella-textual-editor"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/"
github: 'https://github.com/eclipse/capella-textual-editor'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/'
installIU:
- "org.polarsys.capella.scenario.editor.feature.feature.group"
- 'org.polarsys.capella.scenario.editor.feature.feature.group'
ModelsImporter:
github: 'https://github.com/DSD-DBS/capella-addons'
type: dropin
downloadURL: 'https://github.com/DSD-DBS/capella-addons/releases/download/v0.0.1/com.deutschebahn.models-from-directory-importer_0.0.1_capella_5.x.jar'
fileName: 'com.deutschebahn.models-from-directory-importer_0.0.1_capella_5.x.jar'
54 changes: 33 additions & 21 deletions capella/versions/5.2.0/dropins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@

dropins:
CapellaXHTMLDocGen:
github: "https://github.com/eclipse/capella-xhtml-docgen"
eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.2.0/"
github: 'https://github.com/eclipse/capella-xhtml-docgen'
type: updateSite
eclipseRepository: 'https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.2.0/'
installIU:
- "org.polarsys.capella.docgen.package.feature.feature.group"
- 'org.polarsys.capella.docgen.package.feature.feature.group'
DiagramStyler:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/'
installIU:
- "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group"
- 'com.thalesgroup.mde.capella.diagramstyler.feature.feature.group'
PVMT:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/'
installIU:
- "com.thalesgroup.vpd.property.feature.feature.group"
- 'com.thalesgroup.vpd.property.feature.feature.group'
Filtering:
github: "https://github.com/eclipse/capella-filtering"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/Filtering-updateSite-1.5.2.202111091404.zip!/"
github: 'https://github.com/eclipse/capella-filtering'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/Filtering-updateSite-1.5.2.202111091404.zip!/'
installIU:
- "org.polarsys.capella.filtering.feature.feature.group"
- 'org.polarsys.capella.filtering.feature.feature.group'
Requirements:
github: "https://github.com/eclipse/capella-requirements-vp"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/"
github: 'https://github.com/eclipse/capella-requirements-vp'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/'
installIU:
- "org.polarsys.capella.vp.requirements.feature.feature.group"
- 'org.polarsys.capella.vp.requirements.feature.feature.group'
SubsystemTransition:
github: "https://github.com/eclipse/capella-sss-transition"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/"
github: 'https://github.com/eclipse/capella-sss-transition'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/'
installIU:
- "org.polarsys.capella.transition.system2subsystem.feature.feature.group"
- 'org.polarsys.capella.transition.system2subsystem.feature.feature.group'
TextualEditor:
github: "https://github.com/eclipse/capella-textual-editor"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/"
github: 'https://github.com/eclipse/capella-textual-editor'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/'
installIU:
- "org.polarsys.capella.scenario.editor.feature.feature.group"
- 'org.polarsys.capella.scenario.editor.feature.feature.group'
ModelsImporter:
github: 'https://github.com/DSD-DBS/capella-addons'
type: dropin
downloadURL: 'https://github.com/DSD-DBS/capella-addons/releases/download/v0.0.1/com.deutschebahn.models-from-directory-importer_0.0.1_capella_5.x.jar'
fileName: 'com.deutschebahn.models-from-directory-importer_0.0.1_capella_5.x.jar'
54 changes: 33 additions & 21 deletions capella/versions/6.0.0/dropins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@

dropins:
CapellaXHTMLDocGen:
github: "https://github.com/eclipse/capella-xhtml-docgen"
eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/6.0.0/"
github: 'https://github.com/eclipse/capella-xhtml-docgen'
type: updateSite
eclipseRepository: 'https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/6.0.0/'
installIU:
- "org.polarsys.capella.docgen.package.feature.feature.group"
- 'org.polarsys.capella.docgen.package.feature.feature.group'
DiagramStyler:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F60.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-60.3.1.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F60.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-60.3.1.zip!/'
installIU:
- "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group"
- 'com.thalesgroup.mde.capella.diagramstyler.feature.feature.group'
PVMT:
github: "https://github.com/eclipse/capella/wiki/PVMT"
eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F60.7.0%252Fcom.thalesgroup.vpd.property.repository-60.7.0.zip!/"
github: 'https://github.com/eclipse/capella/wiki/PVMT'
type: updateSite
eclipseRepository: 'jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F60.7.0%252Fcom.thalesgroup.vpd.property.repository-60.7.0.zip!/'
installIU:
- "com.thalesgroup.vpd.property.feature.feature.group"
- 'com.thalesgroup.vpd.property.feature.feature.group'
Filtering:
github: "https://github.com/eclipse/capella-filtering"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.6.0/Filtering-updateSite-1.6.0.202206090715.zip!/"
github: 'https://github.com/eclipse/capella-filtering'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.6.0/Filtering-updateSite-1.6.0.202206090715.zip!/'
installIU:
- "org.polarsys.capella.filtering.feature.feature.group"
- 'org.polarsys.capella.filtering.feature.feature.group'
Requirements:
github: "https://github.com/eclipse/capella-requirements-vp"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.13.1/Requirements-updateSite-0.13.1.202303011400.zip!/"
github: 'https://github.com/eclipse/capella-requirements-vp'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.13.1/Requirements-updateSite-0.13.1.202303011400.zip!/'
installIU:
- "org.polarsys.capella.vp.requirements.feature.feature.group"
- 'org.polarsys.capella.vp.requirements.feature.feature.group'
SubsystemTransition:
github: "https://github.com/eclipse/capella-sss-transition"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/"
github: 'https://github.com/eclipse/capella-sss-transition'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/'
installIU:
- "org.polarsys.capella.transition.system2subsystem.feature.feature.group"
- 'org.polarsys.capella.transition.system2subsystem.feature.feature.group'
TextualEditor:
github: "https://github.com/eclipse/capella-textual-editor"
eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/"
github: 'https://github.com/eclipse/capella-textual-editor'
type: updateSite
eclipseRepository: 'jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/'
installIU:
- "org.polarsys.capella.scenario.editor.feature.feature.group"
- 'org.polarsys.capella.scenario.editor.feature.feature.group'
ModelsImporter:
github: 'https://github.com/DSD-DBS/capella-addons'
type: dropin
downloadURL: 'https://github.com/DSD-DBS/capella-addons/releases/download/v0.0.1/com.deutschebahn.models-from-directory-importer_0.0.1_capella_6.x.jar'
fileName: 'com.deutschebahn.models-from-directory-importer_0.0.1_capella_6.x.jar'
Loading

0 comments on commit 72e213e

Please sign in to comment.