@@ -64,20 +64,22 @@ class LagoonCommands extends DrushCommands implements SiteAliasManagerAwareInter
64
64
* {@inheritdoc}
65
65
*/
66
66
public function __construct () {
67
- // Get default config.
68
- $ lagoonyml = $ this ->getLagoonYml ();
69
- $ this ->api = $ lagoonyml ['api ' ] ?? 'https://api.lagoon.amazeeio.cloud/graphql ' ;
70
- $ this ->endpoint = $ lagoonyml ['ssh ' ] ?? 'ssh.lagoon.amazeeio.cloud:32222 ' ;
71
- $ this ->jwt_token = getenv ('LAGOON_OVERRIDE_JWT_TOKEN ' );
72
- $ this ->projectName = $ lagoonyml ['project ' ] ?? '' ;
73
- $ this ->ssh_port_timeout = $ lagoonyml ['ssh_port_timeout ' ] ?? 30 ;
74
-
75
- // Allow environment variable overrides.
76
- $ this ->api = getenv ('LAGOON_OVERRIDE_API ' ) ?: $ this ->api ;
77
- $ this ->endpoint = getenv ('LAGOON_OVERRIDE_SSH ' ) ?: $ this ->endpoint ;
78
- $ this ->projectName = getenv ('LAGOON_PROJECT ' ) ?: $ this ->projectName ;
79
- $ this ->sshTimeout = getenv ('LAGOON_OVERRIDE_SSH_TIMEOUT ' ) ?: $ this ->sshTimeout ;
80
- $ this ->sshKey = getenv ('LAGOON_SSH_KEY ' );
67
+ if (getenv ('LAGOON ' )) {
68
+ // Get default config.
69
+ $ lagoonyml = $ this ->getLagoonYml ();
70
+ $ this ->api = $ lagoonyml ['api ' ] ?? 'https://api.lagoon.amazeeio.cloud/graphql ' ;
71
+ $ this ->endpoint = $ lagoonyml ['ssh ' ] ?? 'ssh.lagoon.amazeeio.cloud:32222 ' ;
72
+ $ this ->jwt_token = getenv ('LAGOON_OVERRIDE_JWT_TOKEN ' );
73
+ $ this ->projectName = $ lagoonyml ['project ' ] ?? '' ;
74
+ $ this ->ssh_port_timeout = $ lagoonyml ['ssh_port_timeout ' ] ?? 30 ;
75
+
76
+ // Allow environment variable overrides.
77
+ $ this ->api = getenv ('LAGOON_OVERRIDE_API ' ) ?: $ this ->api ;
78
+ $ this ->endpoint = getenv ('LAGOON_OVERRIDE_SSH ' ) ?: $ this ->endpoint ;
79
+ $ this ->projectName = getenv ('LAGOON_PROJECT ' ) ?: $ this ->projectName ;
80
+ $ this ->sshTimeout = getenv ('LAGOON_OVERRIDE_SSH_TIMEOUT ' ) ?: $ this ->sshTimeout ;
81
+ $ this ->sshKey = getenv ('LAGOON_SSH_KEY ' );
82
+ }
81
83
}
82
84
83
85
/**
0 commit comments