Skip to content

Commit

Permalink
Update dist scripts to use hc-releases instead of bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
cbednarski committed Feb 18, 2016
1 parent 944ba1e commit d7f5f02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ default: deps generate test dev

ci: deps test

release: deps test releasebin
release: deps test releasebin package

bin: deps
@echo "WARN: 'make bin' is for debug / test builds only. Use 'make release' for release builds."
@sh -c "$(CURDIR)/scripts/build.sh"

releasebin: deps
@grep 'const VersionPrerelease = ""' version.go > /dev/null ; if [ $$? -ne 0 ]; then \
@grep 'const VersionPrerelease = "dev"' version.go > /dev/null ; if [ $$? -eq 0 ]; then \
echo "ERROR: You must remove prerelease tags from version.go prior to release."; \
exit 1; \
fi
@sh -c "$(CURDIR)/scripts/build.sh"

package:
$(if $(VERSION),,@echo 'VERSION= needed to release; Use make package skip compilation'; exit 1)
@sh -c "$(CURDIR)/scripts/dist.sh $(VERSION)"

deps:
go get github.com/mitchellh/gox
go get golang.org/x/tools/cmd/stringer
Expand Down
19 changes: 2 additions & 17 deletions scripts/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ cd $DIR
# Get the version from the command line
VERSION=$1
if [ -z $VERSION ]; then
echo "Please specify a version."
exit 1
fi

# Make sure we have a bintray API key
if [ -z $BINTRAY_API_KEY ]; then
echo "Please set your bintray API key in the BINTRAY_API_KEY env var."
echo "Please specify version"
exit 1
fi

Expand All @@ -45,13 +39,4 @@ pushd ./pkg/dist >/dev/null 2>&1
shasum -a256 * > ./packer_${VERSION}_SHA256SUMS
popd >/dev/null 2>&1

echo "==> Uploading..."
for ARCHIVE in ./pkg/dist/*; do
ARCHIVE_NAME=$(basename ${ARCHIVE})

echo Uploading: $ARCHIVE_NAME
curl \
-T ${ARCHIVE} \
-umitchellh:${BINTRAY_API_KEY} \
"https://api.bintray.com/content/mitchellh/packer/packer/${VERSION}/${ARCHIVE_NAME}"
done
echo "==> Push with hc-releases"

0 comments on commit d7f5f02

Please sign in to comment.