Skip to content

Commit

Permalink
add travis-ci integration
Browse files Browse the repository at this point in the history
  • Loading branch information
wakeful committed Jan 17, 2018
1 parent 6aa4e95 commit b8a864a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
release/
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: go
go:
- 1.9
script: go vet
before_deploy:
- "./build.sh"
deploy:
provider: releases
api_key:
secure: po0qgaUP0fXGA2eJJeRYMV86rAdb0Lzpw404Dtl4p2XE+SF5yOAbIUKkXCApeg0ypx4dSPacTsRezTKmP/mVAH6mvVsxWxJli4Q0UIN502Jp0Hyl3tj43wTFUzIOfk1oMdUiUaRu8Hu4cyD++l6yXmS8YU5M+9mMxz2TcjZPcT6WMwh6vG1M0rv/JVrl+YQhpecpym9zaMiX4BHPS1Y1ILjgHRCF+/f19Tl8Y8MB/L/XeDK8pKhOW7AK01oN1vVDb6Wr/oEbEueuOMe2/0YFZd5HTugQUvMNfSV2LY5JJCtYCG+PJtjGoQc2ZfDeAj8l3xLhG/ppiCc0NTE6baBkhpPpppv8woBYCLtVqCaG33AF0OtYmK7TfzC6RKISr58iAnCW2bbkRkDLUm5iSRcM9d319MlmT3BCZ+tgngcM1dsF8hubpJNOta74zjTD3abINR6uXtAsJcG8dOfJa8MRpOdv1bi5YaEMCmn147HNjTmxuaMNc1lKwUjonbFEb6NT2gGO6yWn69VbClF1ln/eH+swEvum1degj+SlJYfcw/fGVuliVEZPNYLSOCfLHNVeXk0NGG4Xb430C3O66AnCBtjahbwdHyatxix6YlTQmOzwAwRmzn0jYqVIcDXZIWWItxI13wsrSg5VExKmtRDv4o43Bd76B/qQH7HQyBb+LuI=
skip_cleanup: true
file:
- release/kafka_connect_exporter-linux-amd64
- release/kafka_connect_exporter-linux-amd64.sha256
on:
repo: wakeful/kafka_connect_exporter
branch: master
tags: true
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

VERSION=$(git describe --tags --dirty)
GO_BUILD_CMD="go build -a -installsuffix cgo"
GO_BUILD_LDFLAGS="-s -w -X main.version=$VERSION"

BUILD_PLATFORMS="linux"
BUILD_ARCHS="amd64"

mkdir -p release

for OS in ${BUILD_PLATFORMS[@]}; do
for ARCH in ${BUILD_ARCHS[@]}; do
NAME="./kafka_connect_exporter-$OS-$ARCH"
echo "Building for $OS/$ARCH"
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 $GO_BUILD_CMD -ldflags "$GO_BUILD_LDFLAGS"\
-o "release/$NAME" ./kafka_connect_exporter.go
shasum -a 256 "release/$NAME" > "release/$NAME".sha256
done
done

0 comments on commit b8a864a

Please sign in to comment.