Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
103 lines (85 sloc) 3.83 KB
box: golang:1.8
build:
base-path: /go/src/github.com/wercker/stern
steps:
- script:
name: install govendor
code: go get -u github.com/kardianos/govendor
- script:
name: go vet
code: govendor vet +local
- script:
name: install dependencies
code: govendor sync
- script:
name: go build linux amd64
code: |
export CGO_ENABLED=0
GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -X github.com/wercker/stern.GitCommit=$WERCKER_GIT_COMMIT -X github.com/wercker/stern.PatchVersion=$(( ($(date +%s) - $(date --date=20150101 +%s) )/(60*60*24) )) -X github.com/wercker/stern.Compiled=$(date +%s)" \
-installsuffix cgo \
-o $WERCKER_OUTPUT_DIR/artifacts/latest/linux_amd64/stern
cp $WERCKER_OUTPUT_DIR/artifacts/latest/linux_amd64/stern $WERCKER_REPORT_ARTIFACTS_DIR
- script:
name: go build darwin amd64
code: |
export CGO_ENABLED=0
GOOS=darwin GOARCH=amd64 go build \
-ldflags="-s -X github.com/wercker/stern.GitCommit=$WERCKER_GIT_COMMIT -X github.com/wercker/stern.PatchVersion=$(( ($(date +%s) - $(date --date=20150101 +%s) )/(60*60*24) )) -X github.com/wercker/stern.Compiled=$(date +%s)" \
-installsuffix cgo \
-o $WERCKER_OUTPUT_DIR/artifacts/latest/darwin_amd64/stern
cp $WERCKER_OUTPUT_DIR/artifacts/latest/darwin_amd64/stern $WERCKER_REPORT_ARTIFACTS_DIR
- script:
name: go build windows amd64
code: |
export CGO_ENABLED=0
GOOS=windows GOARCH=amd64 go build \
-ldflags="-s -X github.com/wercker/stern.GitCommit=$WERCKER_GIT_COMMIT -X github.com/wercker/stern.PatchVersion=$(( ($(date +%s) - $(date --date=20150101 +%s) )/(60*60*24) )) -X github.com/wercker/stern.Compiled=$(date +%s)" \
-installsuffix cgo \
-o $WERCKER_OUTPUT_DIR/artifacts/latest/windows_amd64/stern.exe
cp $WERCKER_OUTPUT_DIR/artifacts/latest/windows_amd64/stern.exe $WERCKER_REPORT_ARTIFACTS_DIR
- script:
name: generate SHAs
code: |
cd $WERCKER_OUTPUT_DIR
for f in $(echo "$WERCKER_OUTPUT_DIR/artifacts/latest/linux_amd64/stern" "$WERCKER_OUTPUT_DIR/artifacts/latest/darwin_amd64/stern" "$WERCKER_OUTPUT_DIR/artifacts/latest/windows_amd64/stern.exe"); do
cd $(dirname "$f")
sha256sum $(basename "$f") > SHA256SUMS
done
- script:
name: prepare
code: cp -r scripts $WERCKER_OUTPUT_DIR
release-stable:
steps:
- install-packages:
packages: jshon
- script:
name: version
code: |
export STERN_VERSION=$(./artifacts/latest/linux_amd64/stern --version | awk '{print $3}')
echo "Releasing stern stable v$STERN_VERSION" > $WERCKER_REPORT_MESSAGE_FILE
echo "Releasing stern stable v$STERN_VERSION"
- script:
name: generate release notes
code: |
export RELEASE_NOTES=$(jshon -s "$(./scripts/create-release-notes.sh)" | sed 's/.$//; s/^.//')
echo $RELEASE_NOTES
- github-create-release:
token: $GITHUB_TOKEN
tag: $STERN_VERSION
body: $RELEASE_NOTES
- github-upload-asset:
token: $GITHUB_TOKEN
file: ./artifacts/latest/linux_amd64/stern
filename: stern_linux_amd64
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: ./artifacts/latest/darwin_amd64/stern
filename: stern_darwin_amd64
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: ./artifacts/latest/windows_amd64/stern.exe
filename: stern_windows_amd64.exe
content-type: application/octet-stream
You can’t perform that action at this time.