private void buttonStartDeployment_Click(object sender, EventArgs e) { m_packagePath = textBoxPackagePath.Text; if (string.IsNullOrWhiteSpace(m_packagePath)) { MessageBox.Show("请选择目标目录。"); return; } m_gitPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "./temp_release_" + DateTime.Now.ToString("yyyyMMdd_hh.mm.ss")); if (string.IsNullOrWhiteSpace(m_gitPath)) { MessageBox.Show("请选择目标目录。"); return; } var cloneCmd = "git clone -b developer http://10.1.1.223/cnabs/absmanager.git \"" + m_gitPath + "\""; if (!PackUtils.ExcuteCmd(cloneCmd, true)) { return; } m_absManagementSitePath = Path.Combine(m_gitPath, @"ChineseAbs.ABSManagementSite"); Common.Assert(Directory.Exists(m_absManagementSitePath), "SVN路径不存在"); Common.Assert(GetVersion(m_absManagementSitePath), "旧版本信息获取失败"); ModifyVersionForm modifyVersionForm = new ModifyVersionForm(m_oldVersion); if (modifyVersionForm.ShowDialog() == DialogResult.OK) { string newVersion = modifyVersionForm.GetNewVersion(); PackUtils packUtils = new PackUtils(m_packagePath, m_oldVersion, newVersion, m_absManagementSitePath, m_gitPath, m_versionPath); packUtils.Pack(); } else { Common.Log("用户取消"); return; } modifyVersionForm.Close(); }
private void buttonStartDeployment_Click(object sender, EventArgs e) { m_packagePath = textBoxPackagePath.Text; if (string.IsNullOrWhiteSpace(m_packagePath)) { MessageBox.Show("请选择目标目录。"); return; } m_svnPath = textBoxSvnPath.Text; if (string.IsNullOrWhiteSpace(m_svnPath)) { MessageBox.Show("请选择目标目录。"); return; } m_absManagementSitePath = Path.Combine(m_svnPath, @"chineseabs\app\ChineseAbs.ABSManagementSite\"); Common.Assert(Directory.Exists(m_absManagementSitePath), "SVN路径不存在"); Common.Assert(GetVersion(m_absManagementSitePath), "旧版本信息获取失败"); ModifyVersionForm modifyVersionForm = new ModifyVersionForm(m_oldVersion); if (modifyVersionForm.ShowDialog() == DialogResult.OK) { string newVersion = modifyVersionForm.GetNewVersion(); PackUtils packUtils = new PackUtils(m_packagePath, m_oldVersion, newVersion, m_absManagementSitePath, m_svnPath, m_versionPath); packUtils.Pack(); } else { Common.Log("用户取消"); return; } modifyVersionForm.Close(); }