Skip to content

Commit 2a9348b

Browse files
dseevrunclejack
authored andcommitted
Makefile,scripts/release.sh: revert deletion of TAR_FILENAME/TAR_FILE vars from Makefile and bring back tar target
This corrects an undesired change in logic introduced in #961 Signed-off-by: Bill Robinson <[email protected]>
1 parent 4368384 commit 2a9348b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

Makefile

+16-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ NAME := netplugin
1515
VERSION_FILE := $(NAME)-version
1616
VERSION := `cat $(VERSION_FILE)`
1717
TAR_EXT := tar.bz2
18+
TAR_FILENAME := $(NAME)-$(VERSION).$(TAR_EXT)
19+
TAR_LOC := .
20+
TAR_FILE := $(TAR_LOC)/$(TAR_FILENAME)
1821
GO_MIN_VERSION := 1.7
1922
GO_MAX_VERSION := 1.8
2023
GO_VERSION := $(shell go version | cut -d' ' -f3 | sed 's/go//')
@@ -318,7 +321,19 @@ host-plugin-release:
318321
@echo dev: (need docker login with user in contiv org)
319322
docker plugin push ${CONTIV_V2PLUGIN_NAME}
320323

324+
only-tar:
325+
326+
tar: clean-tar
327+
CONTIV_NODES=1 ${MAKE} build
328+
@tar -jcf $(TAR_FILE) -C $(GOPATH)/src/github.com/contiv/netplugin/bin netplugin netmaster netctl contivk8s netcontiv -C $(GOPATH)/src/github.com/contiv/netplugin/scripts contrib/completion/bash/netctl -C $(GOPATH)/src/github.com/contiv/netplugin/scripts get-contiv-diags
329+
330+
clean-tar:
331+
@rm -f $(TAR_LOC)/*.$(TAR_EXT)
332+
@rm -f ${VERSION_FILE}
333+
321334
# GITHUB_USER and GITHUB_TOKEN are needed be set to run github-release
322-
release:
335+
release: tar
336+
TAR_FILENAME=$(TAR_FILENAME) TAR_FILE=$(TAR_FILE) \
323337
OLD_VERSION=${OLD_VERSION} BUILD_VERSION=${BUILD_VERSION} \
324338
USE_RELEASE=${USE_RELEASE} scripts/release.sh
339+
@make clean-tar

scripts/release.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ if [ -z "$(which github-release)" ]; then
1212
exit 1
1313
fi
1414

15+
16+
if [ -z "${TAR_FILENAME-}" ]; then
17+
echo "TAR_FILENAME needs to be defined to make a release"
18+
exit 1
19+
fi
20+
21+
if [ ! -f "$TAR_FILE" ]; then
22+
echo "TAR_FILE ($TAR_FILE) doesn't exist"
23+
exit 1
24+
fi
25+
1526
if [ -z "$BUILD_VERSION" ]; then
1627
echo "A release requires BUILD_VERSION to be defined"
1728
exit 1
@@ -43,4 +54,6 @@ else
4354
fi
4455

4556
set -x
46-
( (github-release -v release $pre_release -r netplugin -t $BUILD_VERSION -d "**Changelog**<br/>$changelog")) || exit 1
57+
( (github-release -v release $pre_release -r netplugin -t $BUILD_VERSION -d "**Changelog**<br/>$changelog") \
58+
&& (github-release -v upload -r netplugin -t $BUILD_VERSION -n $TAR_FILENAME -f $TAR_FILE \
59+
|| github-release -v delete -r netplugin -t $BUILD_VERSION)) || exit 1

0 commit comments

Comments
 (0)