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 14, 2018
1 parent de3f4b6 commit 8eb8148
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
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: NvHJ1rlXl5hMaQ2iat9/zT0bgTtc+O8AyqBhgJlMHdpXanT1d+zq2ZU6BM6O8nB6jceeocz/ZVmceU3IYCZE9QqYgWMhDphabtLo+ykp7QltQUb4JBqXJ/dIZ/t0nJzMxWbnJ7LrCVs3iXk/jrffCNJXrrO00CC2aT4eu2nS2Vsx3ZZom6Q4kkvu05+iO+3VH6L2obLiUnTPonfZLZQgd4TM+SUaqjvlWOY6/Ubzs6qsf8OpFOazqH7xFkiuDlli5nfpr47Cp0Fw5k0+A9Rk8OmPV6R3LQx9ffOAxbjZDga7qqpohNGZhWgBjMZKc8t/GEHVFHRfRE5bAqG7leEaPJzhyivxP1L4gV/kKBqrEtbvpDIlpCfeHLfL2l65smnN7U4QfA66VY2u/87Ef3YPXo998GMBfdU0YdeuU3yL/EAOSZG/5pnUrwVvPnYQQocnAsYMbYZAzOY8SR/DiT3aFFZ6hL+VkZG4FVWlurL1n5LmGxQWypLE54xQjWtFjcBIEK2eyVHXCCe0rXjDcgHGKbruCWTlbiAN3pqIayQ2W9GpUcAAvTtfzqmFT7wA4rKduY/09rouSF6rCSUCu38uvRx+HGirRahUt11/NlSWYqUAyK2GkNB8yEY2G4dL0KpgN0X6AhJR26UFlgCLb1tTE8Hmexlbnc/rP7/fQfQ1vbY=
skip_cleanup: true
file:
- release/pve_exporter-linux-amd64
- release/pve_exporter-linux-amd64.sha256
on:
repo: wakeful/pve_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="pve_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" pve_exporter.go
shasum -a 256 "release/$NAME" > "release/$NAME".sha256
done
done

0 comments on commit 8eb8148

Please sign in to comment.