Commit 60495fcc authored by Björn Müller's avatar Björn Müller

update config files and connectsTo

Signed-off-by: Björn Müller's avatarBjörn Müller <bjoern.mueller@kanu-baerchen.de>
parent 057f688b
......@@ -15,7 +15,7 @@ fn_configure() {
test "${FILE%.json}" == "$FILE" && continue
curl -sX POST "$CONFIGURE_DBMSAPI/$DBName/_bulk_docs" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
-T "/$CSAR$FILE"
done <<< "$DAs"
}
......
......@@ -16,7 +16,7 @@ fn_configure() {
curl -sX DELETE "$CONFIGURE_APIHOST/$IndexName"
curl -sX POST "$CONFIGURE_APIHOST/$IndexName" \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
-T "/$CSAR$FILE"
done <<< "$DAs"
}
......
......@@ -10,21 +10,23 @@ fn_pkginfo() {
# connect
fn_connect() {
exec > >(sudo tee -a "$CONNECT_EXECDIR/$ChannelType.env")
case "$ChannelType" in
"CouchDB")
echo "VMIP=$VMIP"
echo "DBMSPort=$DBMSPort"
echo "DBUser=$DBUser"
echo "DBPassword=$DBPassword"
echo "DBName=$DBName"
;;
"Elasticsearch")
echo "VMIP=$VMIP"
echo "APIPort=$APIPort"
echo "IndexName=$IndexName"
;;
"CouchDB")
echo "
VMIP=$VMIP
DBMSPort=$DBMSPort
DBUser=$DBUser
DBPassword=$DBPassword
DBName=$DBName
" >$CONNECT_EXECDIR/$ChannelType.env
;;
"Elasticsearch")
echo "
VMIP=$VMIP
APIPort=$APIPort
IndexName=$IndexName
" >$CONNECT_EXECDIR/$ChannelType.env
;;
esac
}
......@@ -34,5 +36,5 @@ source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_connect \
|| echo "ERROR=CONNECT:$CONNECT_PACKAGE"
fn_pkginfo && fn_connect ||
echo "ERROR=CONNECT:$CONNECT_PACKAGE"
......@@ -13,6 +13,8 @@ fn_pkginfo() {
fn_install() {
which git || sudo apt-get -qy install git
which make || sudo apt-get -qy install make
which npm || sudo apt-get -qy install npm
which curl || sudo apt-get -qy install curl
sudo npm --unsafe-perm install --global couch2elastic4sync
sudo git clone "$INSTALL_GITREPO" "$INSTALL_EXECDIR"
......
......@@ -31,4 +31,3 @@ fn_pkginfo && fn_configure \
service nginx reload
service nginx restart
......@@ -40,7 +40,7 @@
<Properties>
<Properties xmlns="http://www.example.org">
<Port/>
<ContainerPort>55984</ContainerPort>
<ContainerPort>5984</ContainerPort>
<ContainerID/>
<ContainerIP/>
<ImageID>ubuntu:18.04</ImageID>
......@@ -67,12 +67,12 @@
<Properties xmlns="http://www.example.org"/>
</Properties>
</NodeTemplate>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="CouchDBMS" minInstances="1" maxInstances="1" type="dch_nodetypes:CouchDBMS_2.3.1-w1-wip1" id="CouchDBMS" winery:x="1656" winery:y="575">
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="CouchDBMS" minInstances="1" maxInstances="1" type="dch_nodetypes:CouchDBMS_2.3.1-w1-wip1" id="CouchDBMS" winery:x="1655" winery:y="568">
<Properties>
<Properties xmlns="http://www.example.org">
<DBMSUser>admin</DBMSUser>
<DBMSUser>db_admin</DBMSUser>
<DBMSPassword>admin_password</DBMSPassword>
<DBMSPort>55984</DBMSPort>
<DBMSPort>5984</DBMSPort>
</Properties>
</Properties>
</NodeTemplate>
......@@ -183,7 +183,7 @@
<RelationshipTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ConnectsTo" type="ToscaBaseTypes:ConnectsTo" id="con_ConnectsTo_0">
<Properties>
<Properties xmlns="http://www.example.org">
<ChannelType/>
<ChannelType>CouchDB</ChannelType>
</Properties>
</Properties>
<SourceElement ref="MusicalCompetitionsApp"/>
......@@ -208,6 +208,11 @@
<TargetElement ref="Elasticsearch"/>
</RelationshipTemplate>
<RelationshipTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ConnectsTo" type="ToscaBaseTypes:ConnectsTo" id="con_ConnectsTo_1">
<Properties>
<Properties xmlns="http://www.example.org">
<ChannelType>Elasticsearch</ChannelType>
</Properties>
</Properties>
<SourceElement ref="MusicalCompetitionsApp"/>
<TargetElement ref="ElasticsearchIndex_1.7.6-w1-wip1_0"/>
</RelationshipTemplate>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment