예제 #1
0
        public string CreateBeta(string product, string version)
        {
            System.DateTime releaseDate          = System.DateTime.Now;
            bool            branchCreated        = false;
            bool            projectVersionEdited = false;
            bool            dllHashCreated       = false;

            CreateBranch createBranch = new CreateBranch();

            createBranch.Description   = "Isolando arquivos";
            createBranch.Dll           = "ForrestGump.ConfigurationManagement.dll";
            createBranch.Class         = "ForrestGump.ConfigurationManagement.CreateBranch";
            createBranch.NewVersion    = string.Format("Beta_{0}_{1}_{2}", product, version, releaseDate.ToString("dd.MM.yy_HH.mm"));
            createBranch.DevRepository = SVNManager.DEV_URL;
            createBranch.Product       = product;
            createBranch.Version       = version;
            createBranch.MappingFile   = "beta.mapping";

            branchCreated = this.ExecuteStep(createBranch);

            string path = Path.Combine(SVNManager.VERSIONS_PATH, product);

            this.Update(path);


            EditProjectVersion editProjectVersion = new EditProjectVersion();

            editProjectVersion.Description   = "Alterando atributos de versão (project.version)";
            editProjectVersion.Dll           = "ForrestGump.ConfigurationManagement.dll";
            editProjectVersion.Class         = "ForrestGump.ConfigurationManagement.EditProjectVersion";
            editProjectVersion.DevRepository = SVNManager.DEV_URL;
            editProjectVersion.Product       = product;
            editProjectVersion.Version       = createBranch.NewVersion;
            editProjectVersion.Status        = "Isolado";
            editProjectVersion.Released      = releaseDate.ToString("dd.MM.yy HH:mm");
            editProjectVersion.Beta          = true;

            projectVersionEdited = this.ExecuteStep(editProjectVersion);

            CreateDLLHash createDLLHash = new CreateDLLHash();

            createDLLHash.Description   = "Criando Hash das DLLs";
            createDLLHash.Dll           = "ForrestGump.ConfigurationManagement.dll";
            createDLLHash.Class         = "ForrestGump.ConfigurationManagement.CreateDLLHash";
            createDLLHash.DevRepository = SVNManager.DEV_URL;
            createDLLHash.Product       = product;
            createDLLHash.Version       = createBranch.NewVersion;

            dllHashCreated = this.ExecuteStep(createDLLHash);

            if (branchCreated && projectVersionEdited && dllHashCreated)
            {
                return(createBranch.NewVersion);
            }
            else
            {
                return(string.Empty);
            }
        }
예제 #2
0
        public bool CreatePatch(string product, string version, string releaseVersion)
        {
            bool branchCreated        = false;
            bool projectVersionEdited = false;
            bool dllHashCreated       = false;

            System.DateTime releaseDate = System.DateTime.Now;

            CreateBranch createBranch = new CreateBranch();

            createBranch.Description   = "Isolando arquivos";
            createBranch.Dll           = "ForrestGump.ConfigurationManagement.dll";
            createBranch.Class         = "ForrestGump.ConfigurationManagement.CreateBranch";
            createBranch.NewVersion    = releaseVersion;
            createBranch.DevRepository = SVNManager.DEV_URL;
            createBranch.Product       = product;
            createBranch.Version       = version;
            createBranch.MappingFile   = "default.mapping";

            branchCreated = this.ExecuteStep(createBranch);

            EditProjectVersion editProjectVersion = new EditProjectVersion();

            editProjectVersion.Description   = "Alterando atributos de versão (project.version)";
            editProjectVersion.Dll           = "ForrestGump.ConfigurationManagement.dll";
            editProjectVersion.Class         = "ForrestGump.ConfigurationManagement.EditProjectVersion";
            editProjectVersion.DevRepository = SVNManager.DEV_URL;
            editProjectVersion.Product       = product;
            editProjectVersion.Version       = createBranch.NewVersion;
            editProjectVersion.Status        = "Desenvolvimento";
            editProjectVersion.Released      = releaseDate.ToString("dd.MM.yy HH:mm");
            editProjectVersion.Beta          = false;

            projectVersionEdited = this.ExecuteStep(editProjectVersion);

            CreateDLLHash createDLLHash = new CreateDLLHash();

            createDLLHash.Description   = "Criando Hash das DLLs";
            createDLLHash.Dll           = "ForrestGump.ConfigurationManagement.dll";
            createDLLHash.Class         = "ForrestGump.ConfigurationManagement.CreateDLLHash";
            createDLLHash.DevRepository = SVNManager.DEV_URL;
            createDLLHash.Product       = product;
            createDLLHash.Version       = createBranch.NewVersion;

            dllHashCreated = this.ExecuteStep(createDLLHash);

            bool success = branchCreated && projectVersionEdited && dllHashCreated;

            if (success)
            {
                SVNManager.Instance.Update(string.Format(@"{0}\{1}", SVNManager.VERSIONS_PATH, product));
            }

            return(success);
        }