Env Test
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
CONFIG_NAME='This is development';
|
||||
CONTAINER_PORT=8094
|
||||
UID=1000
|
||||
|
||||
@@ -11,6 +12,7 @@ REMOTE_COMPOSER_PATH = 'chiefsoft@10.10.10.13:/home/chiefsoft/DevSites/MERMS/
|
||||
DESTINATION_HOME_FOLDER = '/home/chiefsoft/SITES/'
|
||||
|
||||
ANSIBLE_AUTOMATION_SERVER_LOCATION="http://172.16.4.90:3000"
|
||||
ANSIBLE_AUTOMATION_PROJECT_ID="8"
|
||||
|
||||
SOCKET_SERVER_LOCATION="http://10.10.10.13:5006"
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use CodeIgniter\Router\RouteCollection;
|
||||
* @var RouteCollection $routes
|
||||
*/
|
||||
$routes->get('/', 'Home::index');
|
||||
$routes->get('/test', 'Home::what_env');
|
||||
|
||||
$routes->get('/provision/prepare', 'Provision::prepareProvision');
|
||||
$routes->get('/provision/update', 'Provision::updateProvision');
|
||||
|
||||
@@ -9,6 +9,12 @@ class Home extends BaseController
|
||||
return view('welcome_message');
|
||||
}
|
||||
|
||||
public function what_env(): string
|
||||
{
|
||||
$curr_env = $_ENV['CONFIG_NAME'];
|
||||
echo $curr_env;
|
||||
return $curr_env;
|
||||
}
|
||||
public function provision(): string
|
||||
{
|
||||
$public_path = FCPATH;
|
||||
@@ -52,7 +58,7 @@ class Home extends BaseController
|
||||
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
|
||||
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
|
||||
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
|
||||
$composer_template_contents = str_replace("PROVISION_UID", $provisionUID, $composer_template_contents);
|
||||
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
|
||||
//Save to the specific path
|
||||
$destination_composer_path = $ansible_folder."/parts/".$provisionUID."/docker-compose.yml";
|
||||
$composerFile = fopen( $destination_composer_path, "w") or die("Unable to open file!");
|
||||
|
||||
Reference in New Issue
Block a user