Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Update CI and add version command #996

Merged
merged 11 commits into from
Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add deploy stage to CI
Test

test2

asd

asdasd

asd
  • Loading branch information
ebati committed Aug 18, 2017
commit 33610e5cd42f1305b764e7a0185c8fc94531717d
29 changes: 27 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
language: go
sudo: false
notifications:
email: false
jobs:
include:
- stage: test
go_import_path: github.com/golang/dep
install:
- go get -u honnef.co/go/tools/cmd/{gosimple,staticcheck}
- npm install -g codeclimate-test-reporter
Expand All @@ -24,11 +24,13 @@ jobs:
- find . -path ./vendor -prune -o -type f -name "*.go" -printf '%P\n' | xargs ./licenseok
- set -e; for pkg in $PKGS; do go test -race -coverprofile=profile.out -covermode=atomic $pkg; if [[ -f profile.out ]]; then cat profile.out >> coverage.txt; rm profile.out; fi; done
after_success:
- codeclimate-test-reporter < coverage.txt
- echo "CHANGE BACK THIS"
# - codeclimate-test-reporter < coverage.txt
# YAML alias, for settings shared across the simpler builds
- &simple-test
go: 1.7.x
stage: test
go_import_path: github.com/golang/dep
install: skip
env:
- DEPTESTBYPASS501=1
Expand All @@ -53,3 +55,26 @@ jobs:
# Related: https://superuser.com/questions/1044130/why-am-i-having-how-can-i-fix-this-error-shell-session-update-command-not-f
- trap EXIT
- go test -race $(go list ./... | grep -v vendor)
- go: 1.8.x
stage: deploy
go_import_path: github.com/golang/dep
install: skip
script: skip
before_deploy:
- mkdir -p release
- cd cmd/dep
- CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -X main.commitHash=$(git rev-parse --short HEAD 2>/dev/null) -X main.buildDate=$(date --iso-8601=seconds) -X main.version=$(git describe --tags --dirty)" -a -installsuffix cgo -o ../../release/dep-linux-amd64
- CGO_ENABLED=0 GOOS=darwin go build -ldflags "-s -w -X main.commitHash=$(git rev-parse --short HEAD 2>/dev/null) -X main.buildDate=$(date --iso-8601=seconds) -X main.version=$(git describe --tags --dirty)" -a -installsuffix cgo -o ../../release/dep-darwin-amd64
- cd ../..
deploy:
- provider: releases
api_key:
secure: IP1BqLO5WAkI/LFT/4WkiTS7g0zgliUt3y5zqJJKfXatnv4tD/mZIaaJsApjTcVpcI9zbTtZZKFcWPJG3JMVVSUQHSLwupyTk/2dCzUfFadZzRnOtkHysNWJjstYUsNkpr/Qh8Dnvf2HQ7vMA4F2mGMPOA/JT0u4UKJLWmiNdmV0pcqHUqszGnomoXP497bXpvGzn7AMG+QtKe/s5OIihaPoGCfr2UF+tldVPbOuykrlVH8u/Rxv2N8RePjKBNoLWnnMLp6Gg5VvSBJX0Ns7bPx1nQdOiSAY0sNuETe2SDSIoGhuSk9hGppPrCTxcql5SaRnxFigN1zr/XOstFMh9mAzjYG2H2MiRKvRaZFVT8pzvvhSLNKUYsW9G/dts63BJuUdFgV+sp0yeO5al9aR4h7g6QGUlnUJ4rtUE8rB2JINfTFSP1U00i6ihTwDLt7xspAWQ5DaCky3SLeLCuKc9Gj3moMDozW4a2iN/ooujYin3Lbbh65o6bWz71P+sjczb+igXKwOkwxscAwdR7IY3yWJ7hvx0KsDADvLtEeXG4IahL0C7Z2ZzHfAHaLiPvDNZ/CBOzYSjOQDx0c92kFfruts57kwgzNaNUAlzZtv5CdxWZDZ/n2HxOb1Bd74RxW4oyXrxcWS6trHzoPwTJ0RSbO8gfneU7xqBHhp7LXoG4E=
file:
- release/dep-linux-amd64
- release/dep-darwin-amd64
skip_cleanup: true
on:
repo: ebati/dep
branch: ci-make-version
tags: true
8 changes: 4 additions & 4 deletions cmd/dep/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
)

var (
version = "devel"
date string
hash string
version = "devel"
buildDate string
commitHash string
)

const versionHelp = `Show the dep version information`
Expand All @@ -39,7 +39,7 @@ func (cmd *versionCommand) Run(ctx *dep.Ctx, args []string) error {
go version : %s
go compiler : %s
platform : %s/%s
`, version, date, hash,
`, version, buildDate, commitHash,
runtime.Version(), runtime.Compiler, runtime.GOOS, runtime.GOARCH)
return nil
}