Example #1
0
    private static async Task Destroy(ServerProperties properties)
    {
        bool validate = await CredentialList.Validate(properties);

        if (!validate)
        {
            return;
        }

        CredentialList credentialList = CredentialList.FindCredentialsAsset();

        string gcloudBashFilePath = GetFilePath("local_stop");

        string arg;

#if UNITY_EDITOR_WIN
        arg = $"\"{Path.Combine(credentialList.GoogleSDKPath, "google-cloud-sdk\\bin\\gcloud")}\"";
#elif UNITY_EDITOR_OSX
        arg = $"{Path.Combine(credentialList.GoogleSDKPath, "bin/gcloud")}";
#endif

        ShellRequest req = LaunchExternalFile(gcloudBashFilePath, new[] { arg });
    }
Example #2
0
    private static async Task Deploy(ServerProperties properties, string filename)
    {
//		bool validate = await CredentialList.Validate(properties);
//
//		if (!validate)
//			return;
//
//		bool createSettings = CredentialList.CreateServerPropertiesFile(properties);
//
//		if (!createSettings)
//			return;
//
        CredentialList credentialList = CredentialList.FindCredentialsAsset();

//
//		string arg1;
//		string arg2;
//
//#if UNITY_EDITOR_WIN
//		arg1 = $"\"{Path.Combine(credentials.GoogleSDKPath, "google-cloud-sdk\\bin\\gcloud")}\"";
//		arg2 = $"{credentials.ProjectId}";
//#elif UNITY_EDITOR_OSX
//		arg1 = $"{Path.Combine(credentialList.GoogleSDKPath, "bin/gcloud")}";
//		arg2 = $"{CredentialList.GetProjectId(properties, credentialList)}";
//#endif

        //***
        //This is commented cause after Production/Development environment implementation
        //it was not tested properly
        //***
        //LaunchExternalFile(GetFilePath(filename), new[] {arg1, arg2});
        //***
        //Instead of executing commands below directly in terminal
        //we are simply printing them out to Unity console
        //***
        PrintLaunchCmdFor(CredentialList.GetProjectId(properties, credentialList));
    }