當前位置: 首頁>>代碼示例>>Golang>>正文


Golang DebianPackageCreator.CreatePackage方法代碼示例

本文整理匯總了Golang中github.com/bborbe/debian_utils/package_creator_archive.DebianPackageCreator.CreatePackage方法的典型用法代碼示例。如果您正苦於以下問題:Golang DebianPackageCreator.CreatePackage方法的具體用法?Golang DebianPackageCreator.CreatePackage怎麽用?Golang DebianPackageCreator.CreatePackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/bborbe/debian_utils/package_creator_archive.DebianPackageCreator的用法示例。


在下文中一共展示了DebianPackageCreator.CreatePackage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: do

func do(
	debianPackageCreatorArchive debian_package_creator_archive.DebianPackageCreator,
	config_parser debian_config_parser.ConfigParser,
	tarGzPath string,
	configpath string,
	version string,
	targetDir string,
) error {
	if len(tarGzPath) == 0 {
		return fmt.Errorf("parameter %s missing", PARAMETER_CONFLUENCE_TAR_GZ_PATH)
	}
	var err error
	config := createDefaultConfig()
	if len(configpath) > 0 {
		if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
			return err
		}
	}
	config_builder := debian_config_builder.NewWithConfig(config)
	if len(version) > 0 {
		if err := config_builder.Version(version); err != nil {
			return err
		}
	}
	config = config_builder.Build()
	if len(config.Version) == 0 {
		return fmt.Errorf("paramter %s missing", PARAMETER_CONFLUENCE_VERSION)
	}
	sourceDir := fmt.Sprintf("atlassian-bamboo-%s", config.Version)
	return debianPackageCreatorArchive.CreatePackage(tarGzPath, config, sourceDir, targetDir)
}
開發者ID:bborbe,項目名稱:atlassian_utils,代碼行數:31,代碼來源:bamboo_create_deb.go

示例2: do

func do(writer io.Writer, debianPackageCreator debian_package_creator_archive.DebianPackageCreator, config_parser debian_config_parser.ConfigParser, tarGzPath string, configpath string, version string) error {
	if len(tarGzPath) == 0 {
		return fmt.Errorf("parameter %s missing", PARAMETER_SONAR_TAR_GZ)
	}
	var err error
	config := createDefaultConfig()
	if len(configpath) > 0 {
		if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
			return err
		}
	}
	config_builder := debian_config_builder.NewWithConfig(config)
	if len(version) > 0 {
		if err := config_builder.Version(version); err != nil {
			return err
		}
	}
	config = config_builder.Build()
	if len(config.Version) == 0 {
		return fmt.Errorf("paramter %s missing", PARAMETER_SONAR_VERSION)
	}
	sourceDir := fmt.Sprintf("nexus-%s-03", config.Version)
	targetDir := "/opt/nexus"
	return debianPackageCreator.CreatePackage(tarGzPath, config, sourceDir, targetDir)
}
開發者ID:bborbe,項目名稱:nexus_utils,代碼行數:25,代碼來源:nexus_create_deb.go


注:本文中的github.com/bborbe/debian_utils/package_creator_archive.DebianPackageCreator.CreatePackage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。