Beispiel #1
0
// GitPull runs "git pull origin master" in the repository
func GitPull(path string) error {
	srcPath, err := repoSrcPath(path)
	if err != nil {
		return err
	}

	return git.Pull(srcPath)
}
Beispiel #2
0
// UpdateDB syncs the repository and updates it in the database.
func UpdateDB(db repodb.DB, src, path string) []error {
	if err := git.Pull(src); err != nil {
		return []error{fmt.Errorf("git pull: %s", err)}
	}

	b, errs := Build(src, path)
	if len(errs) > 0 {
		return errs
	}

	if err := db.AddBuild(b); err != nil {
		return []error{err}
	}
	return nil
}