예제 #1
0
        /// <summary>
        /// Invokes Deploy.exe tool with provided commandline parameters. Currently only upload MBMP projects, excluding libraries.
        /// </summary>
        /// <param name="opentextPath">Path to folder containing Metastorm projects.
        /// All projects in the folder are recursively searched and then uploaded.</param>
        /// <param name="deployToolPath">Path to "deploy.exe: tool.</param>
        /// <param name="deploymentServiceConfigPath">Path to deployment service configuration file in XML.</param>
        /// <param name="performIntegratedUpdate">Flag indicating whether an update of libraries in projects should be performed.
        /// This update uses internal deploy.exe mechanism</param>
        public static void PerformDeploy(string opentextPath, string deployToolPath, string deploymentServiceConfigPath, bool performIntegratedUpdate)
        {
            if (!File_Toolbox.IsFileLocked(deployToolPath) && !File_Toolbox.IsFileLocked(deploymentServiceConfigPath))
            {
                Console.WriteLine();
                General_Toolbox.PrintContinouslyLine("Uruchamianie narzędzia DEPLOY.EXE z podanymi argumentami");
                General_Toolbox.PrintContinouslyLine("Narzędzie wyśle tylko projekty. Wysyłanie bibliotek jest obecnie wyłączone.");
                General_Toolbox.PrintContinouslyLine("Wysyłanie na środowisko DEV...");

                ProcessStartInfo processInfo = new ProcessStartInfo();

                string argumentsLine = "/dir;" + opentextPath + ";bpmproj" + " " + "/deploymentservice;" + deploymentServiceConfigPath + ";" + "flake;snowflake";

                if (performIntegratedUpdate)
                {
                    argumentsLine += " /forcelibmatch";
                    General_Toolbox.PrintContinouslyLine("Włączone użycie wewnętrzego mechanizmu aktualizacji bibliotek.");
                }
                else
                {
                    General_Toolbox.PrintContinouslyLine("Wyłączenie wewnętrzego mechanizmu aktualizacji bibliotek.");
                }

                processInfo.Arguments       = argumentsLine;
                processInfo.CreateNoWindow  = false;
                processInfo.ErrorDialog     = true;
                processInfo.UseShellExecute = true;
                processInfo.FileName        = deployToolPath;
                processInfo.WindowStyle     = ProcessWindowStyle.Normal;


                using (Process deployexe = Process.Start(processInfo))
                {
                    deployexe.WaitForExit();
                }
            }
            else
            {
                General_Toolbox.PrintContinouslyLine("Program Flake nie był w stanie wywołać narzędzia 'DEPLOY.EXE' ze względu na błędną konfigurację");
            }
        }
예제 #2
0
        /// <summary>
        ///  Creates a txt file in the project folder using data from source variable.
        /// </summary>
        /// <param name="folderPath">Source string to be put into the note.</param>

        public static void MakeNote(string folderPath)
        {
            General_Toolbox.PrintContinously("Sprawdzanie poprawności ścieżki: ");

            var directoryList = File_Toolbox.CollectFoldersList(folderPath, "Sol");

            // if directory is empty an exception is thrown - there is nothing to do
            if (!directoryList.Any())
            {
                General_Toolbox.PrintState(OperationState.FAILURE);
                throw new Empty_Directory_Exception("Brak projektów w folderze! Wyjątek wystąpił w Trac_Toolbox.MakeNote()");
            }

            General_Toolbox.PrintState(OperationState.SUCCESS);

            directoryList.Sort();

            General_Toolbox.PrintContinouslyLine("Znalezione solucje:");

            for (int index = 0; index < directoryList.Count; index++)
            {
                Console.WriteLine(index + ". " + directoryList[index]);
            }

            // trimming from unnecessary folder elements - libs

            Console.WriteLine();
            General_Toolbox.PrintContinouslyLine("Ignorowanie projektów bibliotek.");
            Console.WriteLine();

            directoryList.Remove("TestSVNSol");
            directoryList.Remove(".svn");
            directoryList.Remove("DSAAdministracjaSol");
            directoryList.Remove("CommonLibrarySol");
            directoryList.Remove("CommonSol");

            // generating a note and inserting it into every folder to cause track to redeploy whole solution
            General_Toolbox.PrintContinouslyLine("Notatki dla projektów: ");
            for (int index = 0; index < directoryList.Count; index++)
            {
                if (!File.Exists(folderPath + @"\" + directoryList[index] + @"\TracNote.txt"))
                {
                    // Create a file to write to.
                    using (StreamWriter sw = File.CreateText(folderPath + @"\" + directoryList[index] + @"\TracNote.txt"))
                    {
                        sw.WriteLine("Ostatnia modyfikacja dla narzędzia Trac: " + DateTime.Now.ToString());
                        sw.WriteLine("Utworzył: " + Environment.UserName);
                        sw.Close();
                        Console.WriteLine(index + ". " + directoryList[index]);
                    }
                }
                else if (!File_Toolbox.IsFileLocked(folderPath + @"\" + directoryList[index] + @"\TracNote.txt"))
                {
                    using (FileStream f = new FileStream(folderPath + @"\" + directoryList[index] + @"\TracNote.txt", FileMode.Append, FileAccess.Write))
                        using (StreamWriter sw = new StreamWriter(f))
                            sw.WriteLine("Ostatnia modyfikacja dla narzedzia TRAC: " + DateTime.Now.ToString());
                }
                else
                {
                    throw new IOException("Nie można uzyskać dostępu do plików.");
                }
            }
            General_Toolbox.PrintContinouslyLine("zostały utworzone.");
        }