Skip to content

Commit 8513de5

Browse files
committed
temp merge commit
2 parents 4107cde + 60c5870 commit 8513de5

12 files changed

+27882
-8335
lines changed

Makefile

+46-62
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
REPO ?= riak_explorer
2+
PKG_VERSION ?= $(shell git describe --tags --abbrev=0 | tr - .)
3+
MAJOR ?= $(shell echo $(PKG_VERSION) | cut -d'.' -f1)
4+
MINOR ?= $(shell echo $(PKG_VERSION) | cut -d'.' -f2)
5+
ARCH ?= amd64
6+
OSNAME ?= ubuntu
7+
OSVERSION ?= trusty
8+
DEPLOY_BASE ?= riak-tools/$(REPO)/$(MAJOR).$(MINOR)/$(PKG_VERSION)/$(OSNAME)/$(OSVERSION)/
9+
PKGNAME = $(REPO)-$(PKG_VERSION)-$(ARCH).tar.gz
10+
111
BASE_DIR = $(shell pwd)
212
ERLANG_BIN = $(shell dirname $(shell which erl))
313
REBAR ?= $(BASE_DIR)/rebar
4-
BUILD_DIR ?= _build
514
OVERLAY_VARS ?=
6-
RIAK_BASE ?= root/riak
715

816
.PHONY: deps
917

@@ -15,6 +23,8 @@ recompile:
1523
$(REBAR) compile skip_deps=true
1624
deps:
1725
$(REBAR) get-deps
26+
clean: cleantest relclean
27+
-rm -rf packages
1828
cleantest:
1929
rm -rf .eunit/*
2030
test: cleantest
@@ -24,7 +34,8 @@ itest: recompile cleantest
2434
reitest: cleantest
2535
INTEGRATION_TEST=true $(REBAR) skip_deps=true eunit
2636
relclean:
27-
rm -rf rel/riak_explorer
37+
-rm -rf rel/riak_explorer
38+
-rm -rf rel/root
2839
rel: relclean deps compile
2940
$(REBAR) compile
3041
$(REBAR) skip_deps=true generate $(OVERLAY_VARS)
@@ -33,64 +44,37 @@ stage: rel
3344
$(foreach app,$(wildcard apps/*), rm -rf rel/riak_explorer/lib/$(shell basename $(app))-* && ln -sf $(abspath $(app)) rel/riak_explorer/lib;)
3445
rm -rf rel/riak_explorer/priv/ember_riak_explorer/dist && ln -sf $(abspath priv/ember_riak_explorer/dist) rel/riak_explorer/priv/ember_riak_explorer
3546

36-
riak-addon:
37-
-rm -rf rel/riak-addon
38-
mkdir -p rel/riak-addon/ebin
39-
mkdir -p rel/riak-addon/priv
40-
$(REBAR) compile
41-
cp -R deps/riakc/ebin/* rel/riak-addon/ebin/
42-
cp -R ebin/* rel/riak-addon/ebin/
43-
cp -R priv/* rel/riak-addon/priv/
44-
45-
riak-package: compile
46-
-rm -rf rel/$(RIAK_BASE)
47-
mkdir -p rel/$(RIAK_BASE)/lib/basho-patches
48-
mkdir -p rel/$(RIAK_BASE)/priv
49-
cp -R deps/riakc/ebin/* rel/$(RIAK_BASE)/lib/basho-patches/
50-
cp -R ebin/* rel/$(RIAK_BASE)/lib/basho-patches/
51-
cp -R priv/* rel/$(RIAK_BASE)/priv/
52-
cd rel && tar -czf riak-explorer.tar.gz root # creates rel/riak-explorer.tar.gz
5347

54-
# Build steps for posterity
55-
## From riak_explorer
56-
# git checkout master && git pull && git checkout riak-addon-master && git pull origin master
57-
## From riak-explorer-gui
58-
# git checkout master && git pull && git checkout riak-addon-master && git pull origin master && make && rm -rf ../riak_explorer/priv/ember_riak_explorer/dist/* && cp -R dist/* ../riak_explorer/priv/ember_riak_explorer/dist/
59-
## From riak_explorer
60-
# git commit -a -m "udating gui" && git push origin riak-addon-master
61-
# make riak-addon && git checkout master
62-
## From riak-explorer-gui
63-
# git checkout master && make && rm -rf ../riak_explorer/priv/ember_riak_explorer/dist/* && cp -R dist/* ../riak_explorer/priv/ember_riak_explorer/dist/
64-
## From riak_explorer
65-
# git commit -a -m "udating gui" && git push origin master
66-
# make rel
48+
##
49+
## Packaging targets
50+
##
51+
tarball-standalone: rel
52+
echo "Creating packages/"$(PKGNAME)
53+
mkdir -p packages
54+
tar -C rel -czf $(PKGNAME) $(REPO)/
55+
mv $(PKGNAME) packages/
56+
cd packages && shasum -a 256 $(PKGNAME) > $(PKGNAME).sha
57+
sync-standalone:
58+
echo "Uploading to "$(DEPLOY_BASE)
59+
cd packages && \
60+
s3cmd put --acl-public $(PKGNAME) s3://$(DEPLOY_BASE) && \
61+
s3cmd put --acl-public $(PKGNAME).sha s3://$(DEPLOY_BASE)
6762

68-
## Package steps for posterity
69-
## From riak_explorer
70-
# make package-mac
71-
# make deploy-mac
72-
73-
# Deployment
74-
deploy-mac:
75-
cd $(BUILD_DIR) && s3cmd put --acl-public riak_explorer_darwin_amd64.tar.gz s3://riak-tools/
76-
cd $(BUILD_DIR) && s3cmd put --acl-public riak_explorer_addon_darwin_amd64.tar.gz s3://riak-tools/
77-
deploy-linux:
78-
cd $(BUILD_DIR) && s3cmd put --acl-public riak_explorer_linux_amd64.tar.gz s3://riak-tools/
79-
cd $(BUILD_DIR) && s3cmd put --acl-public riak_explorer_addon_linux_amd64.tar.gz s3://riak-tools/
80-
81-
# Packaging
82-
clean-package:
83-
-rm -rf $(BUILD_DIR)
84-
mkdir -p $(BUILD_DIR)
85-
package-mac: clean-package
86-
cd rel && tar -zcvf riak_explorer_darwin_amd64.tar.gz riak_explorer
87-
mv rel/riak_explorer_darwin_amd64.tar.gz $(BUILD_DIR)/
88-
cd rel && tar -zcvf riak_explorer_addon_darwin_amd64.tar.gz riak-addon
89-
mv rel/riak_explorer_addon_darwin_amd64.tar.gz $(BUILD_DIR)/
90-
package-trusty64:
91-
cd vagrant/ubuntu/trusty64 && vagrant up
92-
package-linux: clean-package
93-
cd rel && tar -zcvf riak_explorer_linux_amd64.tar.gz riak_explorer
94-
mv rel/riak_explorer_linux_amd64.tar.gz $(BUILD_DIR)/
95-
cd rel && tar -zcvf riak_explorer_addon_linux_amd64.tar.gz riak-addon
96-
mv rel/riak_explorer_addon_linux_amd64.tar.gz $(BUILD_DIR)/
63+
RIAK_BASE ?= root
64+
tarball: compile
65+
echo "Creating packages/"$(PKGNAME)
66+
-rm -rf rel/$(RIAK_BASE)
67+
mkdir -p rel/$(RIAK_BASE)/riak/lib/basho-patches
68+
mkdir -p rel/$(RIAK_BASE)/riak/priv
69+
cp -R deps/riakc/ebin/* rel/$(RIAK_BASE)/riak/lib/basho-patches/
70+
cp -R ebin/* rel/$(RIAK_BASE)/riak/lib/basho-patches/
71+
cp -R priv/* rel/$(RIAK_BASE)/riak/priv/
72+
mkdir -p packages
73+
tar -C rel -czf $(PKGNAME) root
74+
mv $(PKGNAME) packages/
75+
cd packages && shasum -a 256 $(PKGNAME) > $(PKGNAME).sha
76+
sync:
77+
echo "Uploading to "$(DEPLOY_BASE)
78+
cd packages && \
79+
s3cmd put --acl-public $(PKGNAME) s3://$(DEPLOY_BASE) && \
80+
s3cmd put --acl-public $(PKGNAME).sha s3://$(DEPLOY_BASE)

0 commit comments

Comments
 (0)