Skip to content

Commit

Permalink
Merge pull request elastic#12 from ruflin/latest
Browse files Browse the repository at this point in the history
Add latest script to create latest file for nightlies
  • Loading branch information
andrewkroh committed Oct 19, 2015
2 parents aa4f05e + 3bae202 commit 501114a
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 5 additions & 1 deletion platforms/binary/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion platforms/centos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion platforms/darwin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion platforms/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion platforms/windows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions xgo-scripts/latest.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 501114a

Please sign in to comment.