Skip to content

Commit

Permalink
Merge pull request elastic#4 from tsg/travis_build
Browse files Browse the repository at this point in the history
Use Travis to build packages and upload them to S3
  • Loading branch information
ruflin committed Sep 24, 2015
2 parents fcab5d1 + 458a409 commit 6fdab33
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sudo: required
services:
- docker

language: go

go:
- 1.5.1

before_install:
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"

script:
- make pull-images
# uncomment to build fresh images
# - make images
# - make push-images
- make deps
- make

deploy:
provider: s3
access_key_id: AKIAIAXUU3N2C6EHT5GQ
secret_access_key:
secure: VG6DjUxIf4A1Im2XEXNpzDYxCtQxFCdWs7loKmrXl3r6W/EGiBV0CaZ8f2qqh6sV/jRYegc3J8Qq0R6T4aVDoGznArxmLYOXa1stTuO5l5K0y79CYCypkv7XlYi0cUG9iHmTRi8X+Im4P1FZl8n8q1s8YhHguLIRvhvCGjHGYm/OqdM6RVAEMwjDNTT2SdAaILnmJWdjz6TVjHU9dwuses+0gQww2kYSyWm6c86TiDjwTLcLJWhh2QJXbUcaNeu646Y/imcjdQ0UZuxmz63cO7cdeOs2jejwuFGq0ABfZPtUF7Rm1k9e/HxCzGc5m5XYutnHm8+1gh8UMBojNR/kQkPcO8YpERIGy85ndEnmWxSKXWLF6aH23EtWVDGQrWue92eXrCwkrHqNrJFoB87f7xL/sSgf/u08nC6DCZhQE22RJrKaw9cw9lUqg6ExtVmAM5TKrt1KuVD2ehI+3Ml8GN6HCIZxSmLfze6nuYwaXTKC4gCYL+QQYhbPOvpyMH6Mumh4m7Z2EwXW/LGje/dMWYO/YFQ+TjUYnfElAMvAgKmMzmUP2aZcKHR6o1urftW16iYys8GRpbr3lG+Gnvzpl8qMA8Px8c8xXPgoRxJJzRnITBIJndx2LknpNN8VD4nbGPqXFirFG1kwVd87osa0Ogg2kxlwkxJqXyuZWjgIuGA=
bucket: beats-nightlies
local-dir: build/upload
acl: public_read
on:
repo: elastic/beats-packer
branch: master
34 changes: 26 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ all: packetbeat/deb packetbeat/rpm packetbeat/darwin packetbeat/win packetbeat/b


.PHONY: packetbeat topbeat
packetbeat topbeat: xgo-image build
packetbeat topbeat: build
cd build && xgo -image=tudorg/beats-builder \
-before-build=../xgo-scripts/$@_before_build.sh \
-branch $(RELEASE) \
github.com/elastic/$@

.PHONY: packetbeat-linux topbeat-linux
packetbeat-linux: xgo-image build
packetbeat-linux: build
cd build && xgo -image=tudorg/beats-builder-deb6 \
-before-build=../xgo-scripts/packetbeat_before_build.sh \
-branch $(RELEASE) \
github.com/elastic/packetbeat
topbeat-linux: xgo-image build
topbeat-linux: build
cd build && xgo -image=tudorg/beats-builder-deb6 \
-before-build=../xgo-scripts/topbeat_before_build.sh \
-branch $(RELEASE) \
Expand All @@ -34,17 +34,17 @@ topbeat-linux: xgo-image build
ARCH=386 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/centos/build.sh
ARCH=amd64 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/centos/build.sh

%/darwin: % fpm-image
%/darwin: %
ARCH=amd64 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/darwin/build.sh

%/win: % fpm-image
%/win: %
ARCH=amd64 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/windows/build.sh

%/bin: %-linux fpm-image
%/bin: %-linux
ARCH=386 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/binary/build.sh
ARCH=amd64 RELEASE=$(RELEASE) BEAT=$(@D) BUILDID=$(BUILDID) ./platforms/binary/build.sh

.PHONY: deps xgo-image
.PHONY: deps
deps:
go get github.com/tsg/xgo
go get github.com/tsg/gotpl
Expand All @@ -62,7 +62,7 @@ fpm-image:
go-daemon-image:
docker build --rm=true -t tudorg/go-daemon docker/go-daemon/

build/god-linux-386 build/god-linux-amd64: go-daemon-image
build/god-linux-386 build/god-linux-amd64:
docker run -v $(shell pwd)/build:/build tudorg/go-daemon

build:
Expand All @@ -82,6 +82,24 @@ run-interactive:
docker run -t -i -v $(shell pwd)/build:/build \
-v $(shell pwd)/xgo-scripts/:/scripts \
--entrypoint=bash tudorg/beats-builder-deb6

.PHONY: images
images: xgo-image fpm-image go-daemon-image

.PHONY: push-images
push-images:
docker push tudorg/beats-builder
docker push tudorg/beats-builder-deb6
docker push tudorg/fpm
docker push tudorg/go-daemon

.PHONY: pull-images
pull-images:
docker pull tudorg/beats-builder
docker pull tudorg/beats-builder-deb6
docker pull tudorg/fpm
docker pull tudorg/go-daemon

.PHONY: clean
clean:
rm -rf build/ || true
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ Tools, scripts and docker images for cross-compiling and packaging the Elastic

## Prepare

You need Go and docker installed. Prepare the rest with:
You need Go and docker installed. This project uses several docker files, you
can either build them with:

make images

Or pull them from the Docker registry with:

make pull-images

Prepare the rest with:

make deps

Expand Down

0 comments on commit 6fdab33

Please sign in to comment.