Skip to content

Commit

Permalink
Criteo Build with travis
Browse files Browse the repository at this point in the history
  • Loading branch information
pierresouchay committed Sep 15, 2018
1 parent 48d287e commit ba79642
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
language: go

go:
- "1.x"

branches:
only:
- master
- f-envoy

matrix:
include:
- env: GOTEST_PKGS="./api"
- env: GOTEST_PKGS="./agent"
- env: GOTEST_PKGS="./agent/consul"
- env: GOTEST_PKGS_EXCLUDE="./api|./agent|./agent/consul"
- "1.10.x"

script:
- make test-ci
- find . -type f -name "*go" | xargs sed 's|github.com/hashicorp/consul|github.com/criteo-forks/consul|' -i
- export VERSION=$(echo $TRAVIS_TAG | sed 's/^v//' )
- export PRERELEASE=$(echo $VERSION | cut -d '-' -f 2)
- sed -i "s/VersionPrerelease = \".*\"/VersionPrerelease = \"$PRERELEASE\"/" version/version.go
- make -j 3 multiarch

sudo: false

before_deploy:
- echo "Deploying $VERSION(-$PRERELEASE) to GitHub releases"
- for d in $(find ./pkg/bin -maxdepth 1 -mindepth 1 -type d | cut -d '/' -f4); do zip -j consul_${VERSION}_${d}.zip ./pkg/bin/${d}/consul* ; done

deploy:
provider: releases
api_key:
secure: c0SoffOXSIgvL/gBfyl85bPJL2sTuXlPYzusD/RZ5t8RL76tSSK3I/T94m/7KDkQbUTjCoKv8ZrPMDz+JAqDq+8RMP4nnEcxifKOHXs6yZZK2rRHRkbHIz/VY9UmPNc6fdhj8h1f+EGZ1/tfFxKt7Ij5FdogAR2vFdpVYiRUIJqmcpez2VK4aDzSmHC9Paqly9PVC50KXBIKNSRPn5JbttxyFxJP6Trjcd8H6Mw7lwxv38En8qAfd73ODDaWB8wvB3LtD8+mPtENU/YPB68R//KFh8uvtmdk3zFK9g8wck+8eyrbfR15b90kwsQYlMJKfP+zz/twatZTkow/2k82uIrkjJJvaFqQO6E4ZnkJY9y17pPfXn7rB9sapddmSqyBAYt6sg/M9QcyoXXfTeLciGE5j+jdyPq2mRBeRSf4Z6H43qYdLjc5DakjaF0zM3GzAUed0D+2kkE2Jmmaso9v/zTEm6BUUB2Jh2/Hexa08jY1KHni46kD2EPaeBj3AP0xw9ZNeneIfT5EA2QfKjXlo6iPHlbkg+5i0ObSMtZfe57zrJjQ5K0m9TTOlZTs0ivWDptBNL17O/OhbBR2twC8ZgZUH3uh9chHeNoNhOBJfGm4zvJoWJILxbeMl+Z97vCXe5VCdoLfrZt6txPe4xpTiEcmsPX+KDVQxsPBxxmeK1o=
file_glob: true
file: consul_*.zip
skip_cleanup: true
on:
repo: criteo-forks/consul
tags: true
14 changes: 14 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ changelogfmt:
linux:
@$(SHELL) $(CURDIR)/build-support/scripts/build-local.sh -o linux -a amd64

pkg/bin/windows_amd64/consul.exe:
mkdir -p pkg/bin/windows_amd64
GOOS=windows GOARCH=amd64 go build -o pkg/bin/windows_amd64/consul.exe

pkg/bin/linux_amd64/consul:
mkdir -p pkg/bin/linux_amd64
GOOS=linux GOARCH=amd64 go build -o pkg/bin/linux_amd64/consul

pkg/bin/darwin_amd64/consul:
mkdir -p pkg/bin/darwin_amd64
GOOS=darwin GOARCH=amd64 go build -o pkg/bin/darwin_amd64/consul

multiarch: pkg/bin/windows_amd64/consul.exe pkg/bin/linux_amd64/consul pkg/bin/darwin_amd64/consul

# dist builds binaries for all platforms and packages them for distribution
dist:
@$(SHELL) $(CURDIR)/build-support/scripts/release.sh -t '$(DIST_TAG)' -b '$(DIST_BUILD)' -S '$(DIST_SIGN)' $(DIST_VERSION_ARG) $(DIST_DATE_ARG) $(DIST_REL_ARG)
Expand Down

0 comments on commit ba79642

Please sign in to comment.