Exemple #1
0
func getRevision() (string, error) {
	revision := utils.GetCurrentRevision()
	if revision == "" {
		return revision, errors.New("Can't determine current revision, please use REVISION env var to specify it")
	}
	return revision, nil
}
Exemple #2
0
}

type UpdateSet struct {
	ID                 int                            `json:"id"`
	RequirementUpdates map[string][]RequirementUpdate `json:"requirement_updates"`
	VersionUpdates     map[string][]VersionUpdate     `json:"version_updates"`
}

type UpdateSetResult struct {
	UpdateSetID     int                     `json:"-"`
	ProjectSlug     string                  `json:"-"`
	State           string                  `json:"state"`
	DependencyFiles []models.DependencyFile `json:"dependency_files"`
}

var ErrProjectRevisionEmpty error = fmt.Errorf("The current revision (%s) is unknown on Gemnasium, please push your dependency files before running autoupdate.\nSee `gemnasium df help push`.\n", utils.GetCurrentRevision())

// Apply the best dependency files that have been found so far
func Apply(projectSlug string, testSuite []string) error {
	err := checkProject(projectSlug)
	if err != nil {
		return err
	}

	dfiles, err := fetchDependencyFiles(projectSlug)
	if err != nil {
		return err
	}

	err = updateDepFiles(dfiles)
	if err != nil {