Commit 1d48e789 authored by Philip Schildkamp's avatar Philip Schildkamp

Add nodejs to mcd

parent 390a4c6c
......@@ -22,10 +22,11 @@ fn_pkgrepo() {
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/couchdb.list \
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL $DISTRIB_CODENAME main"
sudo apt-get -qy update
fn_pkginfo
}
# install
......@@ -46,5 +47,5 @@ source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_pkginfo && fn_install \
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
......@@ -22,10 +22,11 @@ fn_pkgrepo() {
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/couchdb.list \
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL $DISTRIB_CODENAME main"
sudo apt-get -qy update
fn_pkginfo
}
# install
......@@ -46,5 +47,5 @@ source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_pkginfo && fn_install \
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
......@@ -15,7 +15,7 @@ fn_pkginfo() {
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo rm /etc/apt/sources.list.d/couchdb.list
sudo rm /etc/apt/sources.list.d/$INSTALL_PACKAGE.list
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
......
......@@ -15,7 +15,7 @@ fn_pkginfo() {
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo rm /etc/apt/sources.list.d/couchdb.list
sudo rm /etc/apt/sources.list.d/$INSTALL_PACKAGE.list
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
......
......@@ -22,10 +22,11 @@ fn_pkgrepo() {
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/elasticsearch.list \
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL stable main"
sudo apt-get -qy update
fn_pkginfo
}
# install
......@@ -41,5 +42,5 @@ source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_pkginfo && fn_install \
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
......@@ -22,10 +22,11 @@ fn_pkgrepo() {
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/elasticsearch.list \
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL stable main"
sudo apt-get -qy update
fn_pkginfo
}
# install
......@@ -41,5 +42,5 @@ source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_pkginfo && fn_install \
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
......@@ -15,7 +15,7 @@ fn_pkginfo() {
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo rm /etc/apt/sources.list.d/elasticsearch.list
sudo rm /etc/apt/sources.list.d/$INSTALL_PACKAGE.list
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
......
......@@ -15,7 +15,7 @@ fn_pkginfo() {
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo rm /etc/apt/sources.list.d/elasticsearch.list
sudo rm /etc/apt/sources.list.d/$INSTALL_PACKAGE.list
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
......
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=musical-competitions
INSTALL_VERSION=0.0.1
# ----------------------------------------------------------------------------
INSTALL_GITREPO=https://github.com/amarcic/PreisausschreibenApp
}
# install
fn_install() {
which git || sudo apt-get -qy install git
sudo npm install --global couch2elastic4sync
sudo git clone $INSTALL_GITREPO /opt/$INSTALL_PACKAGE
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1">
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" xmlns:selfservice="http://www.eclipse.org/winery/model/selfservice" xmlns:testwineryopentoscaorg="http://test.winery.opentosca.org" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1">
<ArtifactTemplate xmlns:artifacttypes="http://opentosca.org/artifacttypes" name="MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1" type="artifacttypes:ConfigurationArtifact" id="MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part1.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part2.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part3.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part4.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part5.json"/>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-CouchDB_0.0.1-w1-wip1/files/mcd-2019-07-01.part6.json"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-OpenJDK-JRE-IA-Configure_8u212-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="OpenJDK-JRE-IA-Configure_8u212-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="OpenJDK-JRE-IA-Configure_8u212-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/OpenJDK-JRE-IA-Configure_8u212-w1-wip1/files/configure.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-OpenJDK-JRE-IA-Install_8u212-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="OpenJDK-JRE-IA-Install_8u212-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="OpenJDK-JRE-IA-Install_8u212-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/OpenJDK-JRE-IA-Install_8u212-w1-wip1/files/install.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=nodejs
INSTALL_VERSION=10.16.0
# ----------------------------------------------------------------------------
INSTALL_REPOKEY=https://deb.nodesource.com/gpgkey/nodesource.gpg.key
INSTALL_REPOURL=https://deb.nodesource.com/node_10.x
INSTALL_REPOTAG=$(
sudo apt-cache show $INSTALL_PACKAGE \
| grep -m1 "Version: $INSTALL_VERSION" \
| awk '{print $2}'
)
}
# debrepo
fn_pkgrepo() {
which curl || sudo apt-get -qy install curl
which gpg || sudo apt-get -qy install gnupg
sudo apt-get -qy install ca-certificates
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL $DISTRIB_CODENAME main"
sudo apt-get -qy update
fn_pkginfo
}
# install
fn_install() {
test -n "$INSTALL_REPOTAG" || return 1
sudo apt-get -qy install $INSTALL_PACKAGE=$INSTALL_REPOTAG
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=nodejs
INSTALL_VERSION=10.16.0
# ----------------------------------------------------------------------------
INSTALL_REPOKEY=https://deb.nodesource.com/gpgkey/nodesource.gpg.key
INSTALL_REPOURL=https://deb.nodesource.com/node_10.x
INSTALL_REPOTAG=$(
sudo apt-cache show $INSTALL_PACKAGE \
| grep -m1 "Version: $INSTALL_VERSION" \
| awk '{print $2}'
)
}
# debrepo
fn_pkgrepo() {
which curl || sudo apt-get -qy install curl
which gpg || sudo apt-get -qy install gnupg
sudo apt-get -qy install ca-certificates
curl -s $INSTALL_REPOKEY | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/$INSTALL_PACKAGE.list \
<<< "deb $INSTALL_REPOURL $DISTRIB_CODENAME main"
sudo apt-get -qy update
fn_pkginfo
}
# install
fn_install() {
test -n "$INSTALL_REPOTAG" || return 1
sudo apt-get -qy install $INSTALL_PACKAGE=$INSTALL_REPOTAG
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_pkgrepo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-OpenJDK-JRE-IA-Uninstall_8u212-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="OpenJDK-JRE-IA-Uninstall_8u212-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="OpenJDK-JRE-IA-Uninstall_8u212-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/OpenJDK-JRE-IA-Uninstall_8u212-w1-wip1/files/uninstall.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
UNINSTALL_PACKAGE=nodejs
UNINSTALL_VERSION=10.16.0
# ----------------------------------------------------------------------------
UNINSTALL_REPOTAG=$(
sudo apt-cache policy $UNINSTALL_PACKAGE \
| grep -m1 "Installed: $UNINSTALL_VERSION" \
| awk '{print $2}'
)
}
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_uninstall \
|| echo "ERROR=UNINSTALL:$UNINSTALL_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
UNINSTALL_PACKAGE=nodejs
UNINSTALL_VERSION=10.16.0
# ----------------------------------------------------------------------------
UNINSTALL_REPOTAG=$(
sudo apt-cache policy $UNINSTALL_PACKAGE \
| grep -m1 "Installed: $UNINSTALL_VERSION" \
| awk '{print $2}'
)
}
# uninstall
fn_uninstall() {
test -n "$UNINSTALL_REPOTAG" || return 1
sudo apt-get -qy purge $UNINSTALL_PACKAGE=$UNINSTALL_REPOTAG
sudo apt-get -qy autoremove
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_uninstall \
|| echo "ERROR=UNINSTALL:$UNINSTALL_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttypes" id="winery-defs-for_dch_artifacttypes-DataArtifact">
<ArtifactType name="DataArtifact" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttypes"/>
</Definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" targetNamespace="http://dch.uni-koeln.de/tosca/nodetypeimplementations" id="winery-defs-for_dch_nodetypeimplementations-Nodejs-Impl_10.16.0-w1-wip1">
<NodeTypeImplementation xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" targetNamespace="http://dch.uni-koeln.de/tosca/nodetypeimplementations" name="Nodejs-Impl_10.16.0-w1-wip1" nodeType="dch_nodetypes:Nodejs-10.16.0-w1-wip1">
<ImplementationArtifacts>
<ImplementationArtifact xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" xmlns:dch_artifacttemplates="http://dch.uni-koeln.de/tosca/artifacttemplates" name="install" interfaceName="http://opentosca.org/interfaces/lifecycle" operationName="install" artifactType="ToscaBaseTypes:ScriptArtifact" artifactRef="dch_artifacttemplates:Nodejs-IA-Install_10.16.0-w1-wip1"/>
<ImplementationArtifact xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" xmlns:dch_artifacttemplates="http://dch.uni-koeln.de/tosca/artifacttemplates" name="configure" interfaceName="http://opentosca.org/interfaces/lifecycle" operationName="configure" artifactType="ToscaBaseTypes:ScriptArtifact" artifactRef="dch_artifacttemplates:Nodejs-IA-Configure_10.16.0-w1-wip1"/>
<ImplementationArtifact xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" xmlns:dch_artifacttemplates="http://dch.uni-koeln.de/tosca/artifacttemplates" name="uninstall" interfaceName="http://opentosca.org/interfaces/lifecycle" operationName="uninstall" artifactType="ToscaBaseTypes:ScriptArtifact" artifactRef="dch_artifacttemplates:Nodejs-IA-Uninstall_10.16.0-w1-wip1"/>
</ImplementationArtifacts>
</NodeTypeImplementation>
</Definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" targetNamespace="http://dch.uni-koeln.de/tosca/nodetypes" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" id="winery-defs-for_dch_nodetypes-Nodejs_10.16.0-w1-wip1">
<NodeType name="Nodejs_10.16.0-w1-wip1" targetNamespace="http://dch.uni-koeln.de/tosca/nodetypes" winery:bordercolor="#88bc5a">
<Interfaces>
<Interface name="http://opentosca.org/interfaces/lifecycle">
<Operation name="install"/>
<Operation name="configure"/>
<Operation name="uninstall"/>
</Interface>
</Interfaces>
</NodeType>
</Definitions>
......@@ -81,7 +81,8 @@
</Properties>
</Properties>
</NodeTemplate>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="Nginx_1.14.0-w1-wip1" minInstances="1" maxInstances="1" type="dch_nodetypes:Nginx_1.14.0-w1-wip1" id="Nginx_1.14.0-w1-wip1" winery:x="750" winery:y="300"/>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="Nodejs_10.16.0-w1-wip1" minInstances="1" maxInstances="1" type="dch_nodetypes:Nodejs_10.16.0-w1-wip1" id="Nodejs_10.16.0-w1-wip1" winery:x="790" winery:y="265"/>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="Nginx_1.14.0-w1-wip1" minInstances="1" maxInstances="1" type="dch_nodetypes:Nginx_1.14.0-w1-wip1" id="Nginx_1.14.0-w1-wip1" winery:x="710" winery:y="335"/>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="MusicalCompetitionsApp_0.0.1-w1-wip1" minInstances="1" maxInstances="1" type="dch_nodetypes:MusicalCompetitionsApp_0.0.1-w1-wip1" id="MusicalCompetitionsApp_0.0.1-w1-wip1" winery:x="750" winery:y="150"/>
<NodeTemplate xmlns:dch_nodetypes="http://dch.uni-koeln.de/tosca/nodetypes" name="ElasticsearchIndex_1.7.6-w1-wip1" minInstances="1" maxInstances="1" type="dch_nodetypes:ElasticsearchIndex_1.7.6-w1-wip1" id="ElasticsearchIndex_1.7.6-w1-wip1" winery:x="400" winery:y="150">
<Properties>
......@@ -115,6 +116,10 @@
<SourceElement ref="Elasticsearch_1.7.6-w1-wip1"/>
<TargetElement ref="OpenJDK-JRE_8u212-w1-wip1"/>
</RelationshipTemplate>
<RelationshipTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="DependsOn" type="ToscaBaseTypes:DependsOn" id="con_DependsOn_1">
<SourceElement ref="MusicalCompetitionsApp_0.0.1-w1-wip1"/>
<TargetElement ref="Nodejs_10.16.0-w1-wip1"/>
</RelationshipTemplate>
<RelationshipTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="HostedOn" type="ToscaBaseTypes:HostedOn" id="con_HostedOn_0">
<SourceElement ref="Elasticsearch_1.7.6-w1-wip1"/>
<TargetElement ref="DockerContainer_2"/>
......@@ -155,6 +160,10 @@
<SourceElement ref="ElasticsearchIndex_1.7.6-w1-wip1"/>
<TargetElement ref="Elasticsearch_1.7.6-w1-wip1"/>
</RelationshipTemplate>
<RelationshipTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="HostedOn" type="ToscaBaseTypes:HostedOn" id="con_HostedOn_10">
<SourceElement ref="Nodejs_10.16.0-w1-wip1"/>
<TargetElement ref="DockerContainer_1"/>
</RelationshipTemplate>
</TopologyTemplate>
</ServiceTemplate>
</Definitions>
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