This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func runClient(dir, user, after string) error { | |
| commits, err := getGitHistory(dir, user, after) | |
| if err != nil { | |
| return err | |
| } | |
| f, err := os.Create("standup.json") | |
| if err != nil { | |
| return err | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| type commit struct { | |
| Author string `xml:"author"` | |
| Date string `xml:"date"` | |
| Message string `xml:"message"` | |
| } | |
| ... | |
| func getGitHistory(dir, user, after string) ([]commit, error) { | |
| var commits []commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getCommits(path, user, after string) ([]byte, error) { | |
| format := ` | |
| <entry> | |
| <author>%an</author> | |
| <date>%cd</date> | |
| <message>%B</message> | |
| </entry>` | |
| cmd := exec.Command("git", "log", "--author="+user, "--pretty=format:"+format, "--after="+after) | |
| cmd.Dir = path | |
| out, err := cmd.Output() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func runClient(dir, user, after string) error { | |
| commits, err := getGitHistory(dir, user, after) | |
| if err != nil { | |
| return err | |
| } | |
| f, err := os.Create("standup.json") | |
| if err != nil { | |
| return err | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| func main() { | |
| app := cli.NewApp() | |
| info(app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "os" | |
| "time" | |
| "github.com/mitchellh/go-homedir" | |
| "github.com/urfave/cli" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func generateContainer(repo, port string) (string, error) { | |
| // get container name | |
| ss := strings.Split(repo, "/") | |
| name := strings.Split(ss[len(ss)-1], ".")[0] | |
| // init docker client | |
| fmt.Println("initializing docker client...") | |
| cli, err := client.NewClientWithOpts(client.WithVersion("1.37")) | |
| if err != nil { | |
| return "", err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/exec" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| repo=$1 # first argument | |
| ss=$(echo $repo | tr "/" " ") # splits repo by '/' | |
| IFS=' ' read -a arr <<< "${ss}"# converts 'ss' into array | |
| len=${#arr[@]} # gets length of array | |
| end=${arr[len-1]} # gets last value in repo (aka project name) | |
| name=${end%????} # remove '.git' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:8 | |
| ARG repo | |
| ARG name | |
| ARG port | |
| RUN git clone $repo | |
| WORKDIR /$name | |
| COPY package*.json ./ |
NewerOlder