private void PublishToFtp(DeployWorkConfig deployWorkConfig) { var directoryName = deployWorkConfig.GetTargetDirectoryPath(); var ftpSetting = deployWorkConfig.PublishFtpUserName == null ? new FtpSetting(deployWorkConfig.PublishFtpUrl) : new FtpSetting(deployWorkConfig.PublishFtpUrl, deployWorkConfig.PublishFtpUserName, deployWorkConfig.PublishFtpPassword); using (var ftp = _ftpFactory.Create(ftpSetting)) { ftp.UploadDirectory(directoryName, deployWorkConfig.PublishFtpPath); } }
private void Compression(DeployWorkConfig deployWorkConfig) { var targetDirectoryPath = deployWorkConfig.GetTargetDirectoryPath(); var compressionFileName = deployWorkConfig.GetCompressionFileName(); var compressionFilePath = deployWorkConfig.GetCompressionFilePath(); _compressor.Compress(targetDirectoryPath, compressionFilePath, deployWorkConfig.CompressionPassword); if (!deployWorkConfig.IsCopyToFtp) { return; } var ftpSetting = deployWorkConfig.FtpUserName == null ? new FtpSetting(deployWorkConfig.FtpUserName) : new FtpSetting(deployWorkConfig.FtpUrl, deployWorkConfig.FtpUserName, deployWorkConfig.FtpPassword); using (var ftp = _ftpFactory.Create(ftpSetting)) { ftp.UploadFile(compressionFilePath, Path.Combine(deployWorkConfig.FtpPath, compressionFileName)); } }
private void PublishToDisk(DeployWorkConfig deployWorkConfig) { var directoryName = deployWorkConfig.GetTargetDirectoryPath(); DirectoryCopy(directoryName, deployWorkConfig.DiskPath, true); }