diff --git a/.travis.yml b/.travis.yml index 5f0e0f27b23..7801b47c7f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ deploy: secret_access_key: secure: Q1UeAGpJSMNvHHHOyGCipV5cHGQPOtprQsc12TJg6GGbvCL8aFUtR8B6Kw3iZC/EvuklaEOcoY0w+nV60J9yHt68kT6y+RUlNaj8ehYvwsVDqH8aSYXecG27EItM93ZtpmFHJ4wCtm7UCM19sLnOBiNZ5YnBbEZx7+2DNL2UZ1tUUspLu+8ZKHk8LI3C5tmXqQQ6gRcFeGewkIbSlBQ8+zXX3wpCpme3W1AQHl4JQwmam4q3Jty+8Oys01HZf8uOFrH4bVevaS0/ThcjVGtE8H5cnZW3YHLtRjLV5Hef3Vs+Ob+3ME0Zl43b/PR6lo0Dj36NeMD31FPtlZ7nf+x0XmCWas58dCHUqXg/eOnCKnw/lop8dgD5+VeZu2MGJQLEOVSs1Ve87mxj2k+C/gKeFVZChnFaFMRhvyRwttcI+8LFMARu50ybn13yaYsnxurbkAh8VOGQjRyBmYoGlqIO3DhJno5PtGzyndMRZ0PkrugrcpqBH0BNQEClGzuITWrEDaX9Or5iHqeFlakwWSkiiLhYeoS8E5JEXYVTST8DowdteOzwqlYGfy/Q/VBY5/qdLSaEFCWITqXzUFzguTALg7dj7lLJJyoJST8ENubcrxTNDorK0ubG0UO2SKlkdRnDJXL+AfigORTDEULqms11ZF+Ga8/85sCdWPBgTd5oi08= bucket: beats-nightlies - local-dir: build/upload + local-dir: build/binary/upload acl: public_read on: repo: elastic/beats-packer diff --git a/Makefile b/Makefile index 2aa443a0daa..893b879c4d7 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,12 @@ RELEASE?=master DATE:=$(shell date +%y%m%d%H%M%S) BUILDID?=$(DATE) + .PHONY: all all: packetbeat/deb packetbeat/rpm packetbeat/darwin packetbeat/win packetbeat/bin \ topbeat/deb topbeat/rpm topbeat/darwin topbeat/win topbeat/bin \ filebeat/deb filebeat/rpm filebeat/darwin filebeat/win filebeat/bin \ - build/upload/build_id.txt + build/upload/build_id.txt latest .PHONY: packetbeat topbeat filebeat packetbeat topbeat filebeat: build/upload @@ -100,3 +101,10 @@ pull-images: .PHONY: clean clean: rm -rf build/ || true + -docker rm -v build-image + +# Creates a latest file for the most recent build +.PHONY: latest +latest: + BUILDID=${BUILDID} \ + ./xgo-scripts/latest.sh diff --git a/platforms/binary/build.sh b/platforms/binary/build.sh index d41343e40c7..0d62e7be7f2 100755 --- a/platforms/binary/build.sh +++ b/platforms/binary/build.sh @@ -8,5 +8,9 @@ runid=binary-$BEAT-$RELEASE-$ARCH cat beats/$BEAT.yml archs/$ARCH.yml releases/$RELEASE.yml > build/settings-$runid.yml gotpl platforms/binary/run.sh.j2 < build/settings-$runid.yml > build/run-$runid.sh chmod +x build/run-$runid.sh -docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid tudorg/fpm /build/run-$runid.sh + +docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid --name build-image tudorg/fpm /build/run-$runid.sh +docker cp build-image:/build/upload `pwd`/build/binary +docker rm -v build-image + rm build/settings-$runid.yml build/run-$runid.sh diff --git a/platforms/centos/build.sh b/platforms/centos/build.sh index 2aab3377709..c24901b2541 100755 --- a/platforms/centos/build.sh +++ b/platforms/centos/build.sh @@ -8,5 +8,9 @@ cat beats/$BEAT.yml archs/$ARCH.yml releases/$RELEASE.yml > build/settings-$runi gotpl platforms/centos/run.sh.j2 < build/settings-$runid.yml > build/run-$runid.sh gotpl platforms/centos/init.j2 < build/settings-$runid.yml > build/$runid.init chmod +x build/run-$runid.sh -docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid tudorg/fpm /build/run-$runid.sh + +docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid --name build-image tudorg/fpm /build/run-$runid.sh +docker cp build-image:/build/upload `pwd`/build/binary +docker rm -v build-image + rm build/settings-$runid.yml build/run-$runid.sh diff --git a/platforms/darwin/build.sh b/platforms/darwin/build.sh index 5f680679b5c..e04652d5787 100755 --- a/platforms/darwin/build.sh +++ b/platforms/darwin/build.sh @@ -8,5 +8,9 @@ runid=darwin-$BEAT-$RELEASE-$ARCH cat beats/$BEAT.yml archs/$ARCH.yml releases/$RELEASE.yml > build/settings-$runid.yml gotpl platforms/darwin/run.sh.j2 < build/settings-$runid.yml > build/run-$runid.sh chmod +x build/run-$runid.sh -docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid tudorg/fpm /build/run-$runid.sh + +docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid --name build-image tudorg/fpm /build/run-$runid.sh +docker cp build-image:/build/upload `pwd`/build/binary +docker rm -v build-image + rm build/settings-$runid.yml build/run-$runid.sh diff --git a/platforms/debian/build.sh b/platforms/debian/build.sh index 369b54e72ad..00a419927bc 100755 --- a/platforms/debian/build.sh +++ b/platforms/debian/build.sh @@ -8,5 +8,9 @@ cat beats/$BEAT.yml archs/$ARCH.yml releases/$RELEASE.yml > build/settings-$runi gotpl platforms/debian/run.sh.j2 < build/settings-$runid.yml > build/run-$runid.sh gotpl platforms/debian/init.j2 < build/settings-$runid.yml > build/$runid.init chmod +x build/run-$runid.sh -docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid tudorg/fpm /build/run-$runid.sh + +docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid --name build-image tudorg/fpm /build/run-$runid.sh +docker cp build-image:/build/upload `pwd`/build/binary +docker rm -v build-image + rm build/settings-$runid.yml build/run-$runid.sh diff --git a/platforms/windows/build.sh b/platforms/windows/build.sh index 08c9cb87fee..0cbf5426c3b 100755 --- a/platforms/windows/build.sh +++ b/platforms/windows/build.sh @@ -10,5 +10,9 @@ gotpl platforms/windows/run.sh.j2 < build/settings-$runid.yml > build/run-$runid gotpl platforms/windows/install-service.ps1.j2 < build/settings-$runid.yml > build/install-service-$BEAT.ps1 gotpl platforms/windows/uninstall-service.ps1.j2 < build/settings-$runid.yml > build/uninstall-service-$BEAT.ps1 chmod +x build/run-$runid.sh -docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid tudorg/fpm /build/run-$runid.sh + +docker run -v `pwd`/build:/build -e BUILDID=$BUILDID -e RUNID=$runid --name build-image tudorg/fpm /build/run-$runid.sh +docker cp build-image:/build/upload `pwd`/build/binary +docker rm -v build-image + rm build/settings-$runid.yml build/run-$runid.sh diff --git a/xgo-scripts/latest.sh b/xgo-scripts/latest.sh new file mode 100755 index 00000000000..4ccc6e0a0cf --- /dev/null +++ b/xgo-scripts/latest.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +FILES=$(find `pwd`/build/binary/* -type f) +echo $BUILDID + +for currentfile in ${FILES}; do + latestfile=${currentfile/$BUILDID/latest} + cp -f $currentfile $latestfile +done