Jaypore CI

> Jaypore CI: Minimal, Offline, Local CI system.
Log | Files | Refs | README | LICENSE

pull.go (573B)


      1 package jci
      2 
      3 import (
      4 	"fmt"
      5 )
      6 
      7 // Pull fetches CI results from remote
      8 func Pull(args []string) error {
      9 	remote := "origin"
     10 	if len(args) > 0 {
     11 		remote = args[0]
     12 	}
     13 
     14 	fmt.Printf("Fetching CI results from %s...\n", remote)
     15 
     16 	// Fetch all refs/jci/* from remote
     17 	_, err := git("fetch", remote, "refs/jci/*:refs/jci/*")
     18 	if err != nil {
     19 		fmt.Printf("Warning: %v\n", err)
     20 	}
     21 
     22 	// Fetch all refs/jci-runs/* from remote
     23 	_, err = git("fetch", remote, "refs/jci-runs/*:refs/jci-runs/*")
     24 	if err != nil {
     25 		fmt.Printf("Warning: %v\n", err)
     26 	}
     27 
     28 	fmt.Println("Done")
     29 	return nil
     30 }