Skip to content

Instantly share code, notes, and snippets.

@roscopecoltran
Forked from jellis/main.go
Created November 16, 2018 00:19
Show Gist options
  • Save roscopecoltran/e1f1e104d44d2a406189c7cf70708cf7 to your computer and use it in GitHub Desktop.
Save roscopecoltran/e1f1e104d44d2a406189c7cf70708cf7 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
//"os"
"io/ioutil"
// "gopkg.in/src-d/go-git.v4"
"gopkg.in/yaml.v2"
)
func main() {
// url := os.Args[1]
// fmt.Printf("Retrieving latest commit from: %q ...\n", url)
// r := git.NewMemoryRepository()
// if err := r.Clone(&git.CloneOptions{URL: url}); err != nil {
// panic(err)
// }
// head, err := r.Head()
// if err != nil {
// panic(err)
// }
// commit, err := r.Commit(head.Hash())
// if err != nil {
// panic(err)
// }
// fmt.Println(commit)
data, err := ioutil.ReadFile("deploy.yml")
if err != nil {
panic(err)
}
var config Config
err = yaml.Unmarshal(data, &config)
fmt.Printf("Value: %#v\n", config)
}
type Config struct {
Install []string
Deploy_method string
Destination string
Number int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment