File tree Expand file tree Collapse file tree 9 files changed +139
-27
lines changed Expand file tree Collapse file tree 9 files changed +139
-27
lines changed Original file line number Diff line number Diff line change 1+ sudo : required
12language : go
23
34go :
4- - 1.7
5+ - 1.9.x
6+
7+ services :
8+ - docker
9+
510script :
6- - go test -coverprofile=coverage.txt -covermode=atomic -coverpkg .
11+ - go test -race -v github.com/seleniumkit/sctl/cmd -coverprofile=coverage.txt -covermode=atomic -coverpkg github.com/seleniumkit/sctl/cmd
12+ - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X github.com/seleniumkit/sctl/cmd.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X github.com/seleniumkit/sctl/cmd.gitRevision=`git describe --tags || git rev-parse HEAD`"
13+ - gox -os "linux darwin" -arch "amd64" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitRevision=`git describe --tags || git rev-parse HEAD`"
14+
15+ before_install :
16+ - go get -u github.com/golang/dep/cmd/dep
17+
18+ install :
19+ - go get -u github.com/mitchellh/gox # cross compile
20+ - dep ensure
21+
22+ deploy :
23+ - provider : releases
24+ api-key : $GITHUB_TOKEN
25+ file_glob : true
26+ file : dist/*
27+ skip_cleanup : true
28+ on :
29+ tags : true
30+ - provider : script
31+ script : travis/docker-push.sh latest
32+ skip_cleanup : true
33+ on :
34+ branch : master
35+ - provider : script
36+ script : travis/docker-push.sh $TRAVIS_TAG
37+ skip_cleanup : true
38+ on :
39+ tags : true
40+ - provider : script
41+ script : travis/docker-push.sh latest-release
42+ skip_cleanup : true
43+ on :
44+ tags : true
745
846after_success :
9- - bash <(curl -s https://codecov.io/bash)
47+ - bash <(curl -s https://codecov.io/bash) -F unittests
Original file line number Diff line number Diff line change 1+ FROM scratch
2+
3+ COPY sctl /
4+
5+ WORKDIR /root
6+ ENTRYPOINT ["/sctl" ]
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+
2+ # Gopkg.toml example
3+ #
4+ # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
5+ # for detailed Gopkg.toml documentation.
6+ #
7+ # required = ["github.com/user/thing/cmd/thing"]
8+ # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
9+ #
10+ # [[constraint]]
11+ # name = "github.com/user/project"
12+ # version = "1.0.0"
13+ #
14+ # [[constraint]]
15+ # name = "github.com/user/project2"
16+ # branch = "dev"
17+ # source = "github.com/myfork/project2"
18+ #
19+ # [[override]]
20+ # name = "github.com/x/y"
21+ # version = "2.4.0"
22+
23+
24+ [[constraint ]]
25+ branch = " master"
26+ name = " github.com/aandryashin/matchers"
27+
28+ [[constraint ]]
29+ name = " github.com/spf13/cobra"
Original file line number Diff line number Diff line change 1919func Execute () {
2020 sctlCmd .AddCommand (generateCmd )
2121 sctlCmd .AddCommand (statCmd )
22+ sctlCmd .AddCommand (versionCmd )
2223
2324 if _ , err := sctlCmd .ExecuteC (); err != nil {
2425 os .Exit (1 )
Original file line number Diff line number Diff line change 1+ package cmd
2+
3+ import (
4+ "fmt"
5+ "github.com/spf13/cobra"
6+ "os"
7+ )
8+
9+ var (
10+ gitRevision string = "HEAD"
11+ buildStamp string = "unknown"
12+ )
13+
14+ var versionCmd = & cobra.Command {
15+ Use : "version" ,
16+ Short : "Show version" ,
17+ Run : func (cmd * cobra.Command , args []string ) {
18+ fmt .Printf ("Git Revision: %s\n " , gitRevision )
19+ fmt .Printf ("UTC Build Time: %s\n " , buildStamp )
20+ os .Exit (0 )
21+ },
22+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ docker build -t $TRAVIS_REPO_SLUG .
6+ docker tag $TRAVIS_REPO_SLUG $TRAVIS_REPO_SLUG :$1
7+ docker login -u=" $DOCKER_USERNAME " -p=" $DOCKER_PASSWORD "
8+ docker push $TRAVIS_REPO_SLUG
9+ docker push $TRAVIS_REPO_SLUG :$1
You can’t perform that action at this time.
0 commit comments