-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abbb27e
commit 2e022fb
Showing
11 changed files
with
141 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
#!/bin/sh | ||
export DISPLAY=:99 | ||
Xvfb $DISPLAY & | ||
/opt/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash $@ | ||
|
||
/opt/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash \ | ||
--modelrepository.cloneModel "${GIT_URL}" \ | ||
--modelrepository.userName "${GIT_USER}" \ | ||
--modelrepository.passFile "/usr/var/passwords/${GIT_PASSWORD_FILE}" \ | ||
--modelrepository.loadModel /tmp/archi-model-clone \ | ||
--saveModel /usr/var/intermediate_files/model.archimate | ||
|
||
rm -f /usr/var/intermediate_files/model2.archimate | ||
if [ "$GIT_URL2" ] | ||
then | ||
/opt/Archi/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash \ | ||
--modelrepository.cloneModel "${GIT_URL2}" \ | ||
--modelrepository.userName "${GIT_USER2}" \ | ||
--modelrepository.passFile "/usr/var/passwords/${GIT_PASSWORD_FILE2}" \ | ||
--modelrepository.loadModel /tmp/archi-model-clone \ | ||
--saveModel /usr/var/intermediate_files/model2.archimate | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cp "${MODELS_FOLDER}/${ARCHI_FILE-model.archimate}" /tmp/archimate.model | ||
(cd /tmp && unzip -o archimate.model model.xml && mv model.xml archimate.model || true) | ||
python /usr/src/archixml2csv.py /tmp/archimate.model | ||
|
||
rm -fr model2 | ||
if [ "$ARCHI_FILE2" ] && [ -f "${MODELS_FOLDER}/${ARCHI_FILE2}" ] | ||
then | ||
cp "${MODELS_FOLDER}/${ARCHI_FILE2}" /tmp/archimate2.model | ||
(cd /tmp && unzip -o archimate2.model model2.xml && mv model2.xml archimate2.model || true) | ||
mkdir -p model2 | ||
cd model2 | ||
python /usr/src/archixml2csv.py /tmp/archimate2.model | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/elements.csv" AS line | ||
MERGE (:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID, type:line.Type, name:line.Name, documentation:line.Documentation, specialization:line.Specialization}) | ||
RETURN count(*) AS `Imported elements:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/relations.csv" AS line | ||
MATCH (s:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.Source}) | ||
MATCH (t:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.Target}) | ||
MERGE (s)-[:Relation{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID, type:replace(line.Type,"Relationship",""), name:line.Name, specialization:line.Specialization}]->(t) | ||
RETURN count(*) AS `Imported relationships:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/views.csv" AS line | ||
MERGE (:Archi_View{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID, name:line.Name, documentation:line.Documentation}) | ||
RETURN count(*) AS `Imported views:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/view-content.csv" AS line | ||
MATCH (c:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.ObjectID}) | ||
MATCH (v:Archi_View{_archi_pwrt_verifier_model_n: 2, archi_id:line.ViewID}) | ||
MERGE (c)-[:Archi_PresentedIn]->(v) | ||
RETURN count(*) AS `Imported elements and relationships in views:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/folders.csv" AS line | ||
MERGE (:Archi_Folder{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID, type:line.Type, name:line.Name,documentation:line.Documentation}) | ||
RETURN count(*) AS `Imported folders:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/folders.csv" AS line | ||
MATCH (f:Archi_Folder{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID}) | ||
MATCH (p:Archi_Folder{_archi_pwrt_verifier_model_n: 2, archi_id:line.Parent}) | ||
MERGE (f)-[:Archi_SubfolderOf]->(p); | ||
|
||
// Problem: The following does not create relationship between a folder and Archi relation in the folder | ||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/folder-content.csv" AS line | ||
MATCH (c:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.ObjectID}) | ||
MATCH (f:Archi_Folder{_archi_pwrt_verifier_model_n: 2, archi_id:line.FolderID}) | ||
MERGE (c)-[:Archi_LivesIn]->(f) | ||
RETURN count(*) AS `Imported elements and relationships in folders:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/properties.csv" AS line | ||
MATCH (n:Element{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID}) | ||
CALL apoc.create.setProperty(n, line.Key, line.Value) | ||
YIELD node | ||
RETURN count(*) AS `Imported elements' properties:`; | ||
|
||
LOAD CSV WITH HEADERS FROM "file:///intermediate_files/model2/properties.csv" AS line | ||
MATCH ()-[r:Relation{_archi_pwrt_verifier_model_n: 2, archi_id:line.ID}]->() | ||
CALL apoc.create.setRelProperty(r, line.Key, line.Value) | ||
YIELD rel | ||
RETURN count(*) AS `Imported relationships' properties:`; | ||
|
||
MATCH (:Element{_archi_pwrt_verifier_model_n: 2})-[rel:Relation{_archi_pwrt_verifier_model_n: 2}]->(:Element{_archi_pwrt_verifier_model_n: 2}) | ||
CALL apoc.refactor.setType(rel,rel.type) | ||
YIELD input, output | ||
REMOVE output.type; | ||
|
||
MATCH (n:Element{_archi_pwrt_verifier_model_n: 2}) | ||
CALL apoc.create.addLabels( id(n), [ n.type ] ) | ||
YIELD node | ||
REMOVE node.type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters