Compare commits

..

2 Commits

Author SHA1 Message Date
2744ab588e move exec() and file name to cfg 2022-09-06 18:15:41 -04:00
b6fe91d20f add aliasName to else clasue 2022-09-06 18:14:23 -04:00

View File

@ -4,7 +4,6 @@
require 'getwebsites.cfg.php'; require 'getwebsites.cfg.php';
// Get password from the "pass" utility. // Get password from the "pass" utility.
exec('/usr/bin/pass ls megaphone/crm/restpassword', $password);
$password = $password[0]; $password = $password[0];
$headers = login($password); $headers = login($password);
@ -27,7 +26,7 @@ foreach ($websites as $website) {
$websiteList[$alias]['ssh'] = $website['server']; $websiteList[$alias]['ssh'] = $website['server'];
} }
else { else {
$alias = '@' . $website['client'] . '-' . strtolower($website['env']); $alias = '@' . $aliasName . '-' . strtolower($website['env']);
} }
$websiteList[$alias]['path'] = $website['webroot']; $websiteList[$alias]['path'] = $website['webroot'];
$websiteList[$alias]['url'] = $website['primary_url']; $websiteList[$alias]['url'] = $website['primary_url'];
@ -36,7 +35,6 @@ foreach ($websites as $website) {
ksort($websiteList); ksort($websiteList);
$aliasesFile = '/etc/wp-cli.yml';
$yaml = yaml_emit_file($aliasesFile, $websiteList); $yaml = yaml_emit_file($aliasesFile, $websiteList);
var_dump($yaml); var_dump($yaml);