示例#1
0
// getAllRemoteResources will get try to get the dependencies from their respective repositories and put them
// in the final "destination" workspace directory.
func getAllRemoteResources(destination string, opencontrol common.OpenControl, getter Getter) error {
	// Get Certifications
	log.Println("Retrieving dependent certifications")
	err := getter.GetRemoteResources(destination, constants.DefaultCertificationsFolder,
		opencontrol.GetCertificationsDependencies())
	if err != nil {
		return err
	}
	// Get Standards
	log.Println("Retrieving dependent standards")
	err = getter.GetRemoteResources(destination, constants.DefaultStandardsFolder,
		opencontrol.GetStandardsDependencies())
	if err != nil {
		return err
	}
	// Get Components
	log.Println("Retrieving dependent components")
	err = getter.GetRemoteResources(destination, constants.DefaultComponentsFolder,
		opencontrol.GetComponentsDependencies())
	if err != nil {
		return err
	}
	return nil
}
示例#2
0
// getAllLocalResources will get try to get the resources that are in the current "source" directory and place them
// in the final "destination" workspace directory.
func getAllLocalResources(source string, destination string, opencontrol common.OpenControl, getter Getter) error {
	// Get Certifications
	log.Println("Retrieving certifications")
	err := getter.GetLocalResources(source, opencontrol.GetCertifications(), destination,
		constants.DefaultCertificationsFolder, false, constants.Certifications)
	if err != nil {
		return err
	}
	// Get Standards
	log.Println("Retrieving standards")
	err = getter.GetLocalResources(source, opencontrol.GetStandards(), destination,
		constants.DefaultStandardsFolder, false, constants.Standards)
	if err != nil {
		return err
	}
	// Get Components
	log.Println("Retrieving components")
	err = getter.GetLocalResources(source, opencontrol.GetComponents(), destination,
		constants.DefaultComponentsFolder, true, constants.Components)
	if err != nil {
		return err
	}
	return nil
}