Luciano Andrade пре 7 година
родитељ
комит
096b83e9df
1 измењених фајлова са 99 додато и 1 уклоњено
  1. 99 1
      tools/src/Release.php

+ 99 - 1
tools/src/Release.php

@@ -32,6 +32,9 @@ class Release extends Command
 	 ->addOption('mapas-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app Mapas', "git@bitbucket.org:ikflowdat/mapas.git")
 	 ->addOption('mapas-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the Mapas app', "master")
 
+	 ->addOption('cablemodem-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app cablemodem', "git@bitbucket.org:ikflowdat/cablemodem.git")
+	 ->addOption('cablemodem-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the cablemodem app', "master")
+
 	 ->addOption('radius-repo',null, InputOption::VALUE_REQUIRED, 'Git clone Url fot the app radius', "git@bitbucket.org:ikflowdat/radius.git")
 	 ->addOption('radius-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone the radius app', "master")
 
@@ -77,7 +80,10 @@ class Release extends Command
 			'url' => $input->getOption("radius-repo"),
 			'branch' => $input->getOption("radius-ref"),
 		),
-
+		"cablemodem" => array(
+			'url' => $input->getOption("cablemodem-repo"),
+			'branch' => $input->getOption("cablemodem-ref"),
+		),
 		"stats" => array(
 			'url' => $input->getOption("stats-repo"),
 			'branch' => $input->getOption("stats-ref"),
@@ -204,6 +210,70 @@ inventory=inventory.ini
 
     }
 
+    function addCablemodem($composer, $config = array(), $flavor = "dev"){ 
+	$version = "latest";
+	$domain = "fd3.flowdat.com";
+	extract($config);
+
+	$composer->addService("cablemodem")
+		->image($registry."fd3/cablemodem:" . $version)
+		->build("./cablemodem/")
+		->restart("always")
+		->addLinks("mysql")
+		->addLinks("base")
+		->addLinks("amqp")
+		->addLinks("base", "base.".$domain)
+
+		->addEnv_file("cablemodem.oauth.env")
+		->addEnviroment("VIRTUAL_HOST", "cablemodem.".$domain)
+		->addEnviroment("HOST_FTTH",	"ftth.".$domain)
+		->addEnviroment("HOST_STATS", 	"stats.".$domain)
+		->addEnviroment("HOST_MAPAS", 	"mapas.".$domain)
+		->addEnviroment("HOST_BASE", 	"base.".$domain)
+		->addEnviroment("HOST_CABLEMODEM", 	"cablemodem.".$domain)
+		//->addEnviroment("OAUTH_CLIENT_ID", $oauth_client)
+		//->addEnviroment("OAUTH_CLIENT_SECRET", $oauth_client_secret)
+		//->addEnviroment("HTTPS_METHOD", 	"nohttps")
+
+		->addVolumes("./cablemodem/", "/opt/cablemodem")
+	;
+
+    }
+
+    function addRadius($composer, $config = array(), $flavor = "dev"){ 
+	$version = "latest";
+	$domain = "fd3.flowdat.com";
+	extract($config);
+
+	$composer->addService("radius")
+		->image($registry."fd3/radius:" . $version)
+		->build("./radius/")
+		->restart("always")
+		->addLinks("mysql")
+		->addLinks("base")
+		->addLinks("amqp")
+		->addLinks("base", "base.".$domain)
+
+		->addEnv_file("radius.oauth.env")
+		->addEnviroment("VIRTUAL_HOST", "radius.".$domain)
+		->addEnviroment("HOST_FTTH",	"ftth.".$domain)
+		->addEnviroment("HOST_STATS", 	"stats.".$domain)
+		->addEnviroment("HOST_MAPAS", 	"mapas.".$domain)
+		->addEnviroment("HOST_BASE", 	"base.".$domain)
+		->addEnviroment("HOST_CABLEMODEM", 	"cablemodem.".$domain)
+		//->addEnviroment("OAUTH_CLIENT_ID", $oauth_client)
+		//->addEnviroment("OAUTH_CLIENT_SECRET", $oauth_client_secret)
+		//->addEnviroment("HTTPS_METHOD", 	"nohttps")
+
+		->addVolumes("./cablemodem/", "/opt/cablemodem")
+	;
+
+    }
+
+
+
+
+
     function addStats($composer, $config = array(), $flavor = "dev"){ 
 	$version = "latest";
 	$domain = "fd3.flowdat.com";
@@ -351,6 +421,25 @@ inventory=inventory.ini
 	;
     }
 
+    function addFreeradius($composer, $config = array(), $flavor = "dev"){
+	$version = "latest";
+	$domain = "fd3.flowdat.com";
+	extract($config);
+
+	$composer->addService("freeradius")
+		->image($registry . "fd3/freeradius:". $version)
+		->addLinks("mysql")
+		->addEnviroment("MYSQL_ROOT_PASSWORD", $mysql_root_pass)
+		->addEnviroment("MYSQL_USER", $mysql_user)
+		->addEnviroment("MYSQL_HOST", "mysql")
+		->addEnviroment("MYSQL_PASSWORD", $mysql_pass)
+
+		->addPorts("1812", "1812/udp")
+		->addPorts("1813", "1813/udp")
+		->addPorts("3799", "3799/udp")
+    	;
+    }
+
     function addGrafana($composer, $config = array(), $flavor = "dev"){
 	$version = "latest";
 	$domain = "fd3.flowdat.com";
@@ -492,6 +581,8 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
 	$this->addBase($composer, $base_vars); 
 	$this->addFtth($composer, $base_vars);
 	$this->addStats($composer, $base_vars);
+	$this->addCablemodem($composer, $base_vars);
+	$this->addRadius($composer, $base_vars);
 	$this->addMapas($composer, $base_vars);
 
 
@@ -511,6 +602,13 @@ $oauth_client_secret = "5w7gx6ptdoo4g8cwwo88o8gowosgco84sso08ssow0osg88g8k";
 	$this->addMongDb($composer, $base_vars);
 	$this->addRedis($composer);
 
+	$this->addFreeradius($composer, $base_vars + array(
+		'mysql_root_pass' => $mysql_root_pass,
+		'mysql_user' => $mysql_user,
+                'mysql_pass' => $mysql_pass,
+		));
+
+
 	/**************************************************************************************/
 	/* Grafana y compoenentes de las estadisticas*/
 	/**************************************************************************************/