Skip to content

Commit 2bcd6c9

Browse files
authored
Merge pull request #1964 from hunchback/release-exporters
exporters: add binary/conf to github skydive release
2 parents 4bdee15 + d6d0876 commit 2bcd6c9

File tree

8 files changed

+67
-31
lines changed

8 files changed

+67
-31
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ bench.flow: bench.flow.traces
422422
.PHONY: static
423423
static: skydive.clean govendor genlocalfiles
424424
$(MAKE) compile.static WITH_LIBVIRT_GO=false
425+
$(MAKE) contribs.static
425426

426427
.PHONY: contribs.clean
427428
contribs.clean: contrib.exporters.clean contrib.snort.clean contrib.collectd.clean
@@ -432,6 +433,10 @@ contribs.test: contrib.exporters.test
432433
.PHONY: contribs
433434
contribs: contrib.exporters contrib.snort contrib.collectd
434435

436+
.PHONY: contribs.static
437+
contribs.static:
438+
$(MAKE) -C contrib/exporters static
439+
435440
.PHONY: contrib.exporters.clean
436441
contrib.exporters.clean:
437442
$(MAKE) -C contrib/exporters clean

contrib/exporters/Makefile

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
BUILD := \
2+
allinone \
3+
awsflowlogs \
24
core \
5+
dummy \
36
secadvisor \
4-
awsflowlogs \
57
vpclogs \
6-
dummy \
7-
uber \
8+
9+
STATIC := \
10+
allinone \
811

912
TEST := \
1013
secadvisor \
@@ -20,3 +23,7 @@ clean:
2023
.PHONY: test
2124
test:
2225
for i in $(TEST); do $(MAKE) -C $$i test; done
26+
27+
.PHONY: static
28+
static:
29+
for i in $(STATIC); do $(MAKE) -C $$i static; done

contrib/exporters/Makefile.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ clean:
1616

1717
.PHONY: test
1818
test: $(TESTS)
19-
cd mod && go test
19+
(cd mod 2>/dev/null && go test) || true
2020

2121
.PHONY: run
2222
run: all

contrib/exporters/uber/Makefile contrib/exporters/allinone/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PROG := uber
1+
PROG := allinone
22

33
SRCS := \
44
main.go \
File renamed without changes.

scripts/ci/create-binaries.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,21 @@ git lfs install
3737

3838
git config --global user.email "[email protected]"
3939
git config --global user.name "Skydive CI"
40-
cp ${GOPATH}/bin/skydive skydive-latest
41-
cp ${GOPATH}/src/github.com/skydive-project/skydive/swagger.json .
42-
git add skydive-latest
43-
git add swagger.json
40+
41+
add() {
42+
local dst=$1
43+
local src=$2
44+
cp $src $dst
45+
git add $dst
46+
}
47+
48+
allinone=$GOPATH/src/github.com/skydive-project/skydive/contrib/exporters/allinone
49+
50+
add skydive-latest ${GOPATH}/bin/skydive
51+
add swagger.json ${GOPATH}/src/github.com/skydive-project/skydive/swagger.json
52+
add skydive-flow-exporter $allinone/allinone
53+
add skydive-flow-exporter.yml $allinone/allinone.yml.default
54+
4455
git commit -m "${BUILD_TAG} Jenkins build" --amend --reset-author
4556
git config credential.helper "store --file=.git/credentials"
4657
echo "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com" > .git/credentials

scripts/ci/create-release.sh

+35-22
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ then
1212
exit 1
1313
fi
1414

15+
user=skydive-project
16+
repo=skydive
17+
18+
cleanup() {
19+
git push --delete origin $TAG || true
20+
github-release delete --user $user --repo $repo --tag ${TAG} || true
21+
}
22+
23+
cleanup_on_error() {
24+
local retcode=$?
25+
if [ $retcode != 0 ]; then
26+
cleanup
27+
exit $retcode
28+
fi
29+
}
30+
31+
release() {
32+
local description="$1"
33+
github-release release ${FLAGS} --user $user --repo $repo --tag ${TAG} --description "$description"
34+
cleanup_on_error
35+
}
36+
37+
upload() {
38+
local name=$1
39+
local file=$2
40+
github-release upload --user $user --repo $repo --tag ${TAG} --name $name --file $file
41+
cleanup_on_error
42+
}
43+
1544
go get github.com/aktau/github-release
1645
cd ${GOPATH}/src/github.com/skydive-project/skydive
1746

@@ -37,30 +66,14 @@ changelog=$(scripts/ci/extract-changelog.py CHANGELOG.md $CHANGELOG_VERSION)
3766
make static WITH_EBPF=true
3867
${dir}/../../contrib/packaging/rpm/generate-skydive-bootstrap.sh -s -r ${TAG}
3968

40-
github-release release ${FLAGS} --user skydive-project --repo skydive --tag ${TAG} --description "$changelog"
41-
retcode=$?
42-
if [ $retcode != 0 ]; then
43-
git push --delete origin $TAG || true
44-
exit $retcode
45-
fi
69+
release "$changelog"
4670

47-
github-release upload --user skydive-project --repo skydive --tag ${TAG} --name skydive --file $GOPATH/bin/skydive
48-
retcode=$?
49-
if [ $retcode != 0 ]; then
50-
git push --delete origin $TAG || true
51-
github-release delete --user skydive-project --repo skydive --tag ${TAG} || true
52-
exit $retcode
53-
fi
71+
allinone=$GOPATH/src/github.com/skydive-project/skydive/contrib/exporters/allinone
5472

55-
github-release upload --user skydive-project --repo skydive --tag ${TAG} --name skydive-${VERSION}.tar.gz --file rpmbuild/SOURCES/skydive-${VERSION}.tar.gz
56-
retcode=$?
57-
if [ $retcode != 0 ]; then
58-
git push --delete origin $TAG || true
59-
github-release delete --user skydive-project --repo skydive --tag ${TAG} || true
60-
exit $retcode
61-
fi
73+
upload skydive $GOPATH/bin/skydive
74+
upload skydive-${VERSION}.tar.gz rpmbuild/SOURCES/skydive-${VERSION}.tar.gz
75+
upload skydive-flow-exporter $allinone/allinone
6276

6377
if [ -n "$DRY_RUN" ]; then
64-
git push --delete origin $TAG || true
65-
github-release delete --user skydive-project --repo skydive --tag ${TAG} || true
78+
cleanup
6679
fi

0 commit comments

Comments
 (0)