Skip to content

Commit fc9419e

Browse files
committed
add brew bundle | v0.0.2-rc.16
* combine cli and certificates projects into one tarball so that `step` and `step-ca` can be built and installed with one run of `brew install ...`
1 parent 9fb9065 commit fc9419e

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

.COMPONENT_VERSIONS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
certificates: v0.0.1-rc.2

Makefile

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ uninstall:
157157
#########################################
158158

159159
debian:
160-
$Q mkdir -p $(RELEASE); \
160+
$Q set -e; mkdir -p $(RELEASE); \
161161
OUTPUT=../step-cli_*.deb; \
162-
rm $$OUTPUT; \
162+
rm -f $$OUTPUT; \
163163
dpkg-buildpackage -b -rfakeroot -us -uc && cp $$OUTPUT $(RELEASE)/
164164

165165
distclean: clean
@@ -182,7 +182,7 @@ binary-darwin:
182182
$(call BUNDLE_MAKE,darwin,amd64,$(BINARY_OUTPUT)darwin/)
183183

184184
define BUNDLE
185-
$(q)BUNDLE_DIR=$(BINARY_OUTPUT)$(1)/bundle; \
185+
$(q)set -e; BUNDLE_DIR=$(BINARY_OUTPUT)$(1)/bundle; \
186186
stepName=step_$(2); \
187187
mkdir -p $$BUNDLE_DIR $(RELEASE); \
188188
TMP=$$(mktemp -d $$BUNDLE_DIR/tmp.XXXX); \
@@ -196,21 +196,42 @@ define BUNDLE
196196
tar -zcvf $$NEW_BUNDLE -C $$TMP $$stepName;
197197
endef
198198

199+
define BUNDLE_BREW
200+
$(q)set -e; BREW_DIR=$(OUTPUT_ROOT)brew; \
201+
mkdir -p $$BREW_DIR $(RELEASE); \
202+
TMP=$$(mktemp -d $$BREW_DIR/tmp.XXXX); \
203+
trap "rm -rf $$TMP" EXIT INT QUIT TERM; \
204+
NAME=brew_step_$(VERSION); \
205+
TAR_DIR=$$TMP/$$NAME; \
206+
mkdir -p $$TAR_DIR; \
207+
git clone https://github.com/smallstep/cli.git $$TAR_DIR/cli; \
208+
git --git-dir="$$TAR_DIR/cli/.git" --work-tree="$$TAR_DIR/cli" checkout v$(VERSION); \
209+
CERT_VERSION=$$(cat .COMPONENT_VERSIONS | grep "certificates" | tr -d "\r\n" | awk '{printf $$2}'); \
210+
git clone https://github.com/smallstep/certificates.git $$TAR_DIR/certificates; \
211+
git --git-dir="$$TAR_DIR/certificates/.git" --work-tree="$$TAR_DIR/certificates" checkout $$CERT_VERSION; \
212+
BREW_TAR=$(RELEASE)/$$NAME.tar.gz; \
213+
rm -f $$BREW_TAR; \
214+
tar -zcvf $$BREW_TAR -C $$TMP $$NAME;
215+
endef
216+
199217
bundle-linux: binary-linux
200218
$(call BUNDLE,linux,$(VERSION),amd64)
201219

202220
bundle-darwin: binary-darwin
203221
$(call BUNDLE,darwin,$(VERSION),amd64)
204222

205-
.PHONY: binary-linux binary-darwin bundle-linux bundle-darwin
223+
brew:
224+
$(call BUNDLE_BREW)
225+
226+
.PHONY: binary-linux binary-darwin bundle-linux bundle-darwin brew
206227

207228
#################################################
208229
# Targets for creating OS specific artifacts
209230
#################################################
210231

211232
artifacts-linux-tag: bundle-linux debian
212233

213-
artifacts-darwin-tag: bundle-darwin
234+
artifacts-darwin-tag: bundle-darwin brew
214235

215236
artifacts-tag: artifacts-linux-tag artifacts-darwin-tag
216237

debian/changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ step-cli (0.0.2-rc.15) UNRELEASED; urgency=medium
33
[ max furman]
44
* step ca commands
55

6+
-- Smallstep Labs, Inc. <[email protected]> Thu, 8 Nov 2018 14:30:00 +0000
7+
8+
step-cli (0.0.2-rc.15) UNRELEASED; urgency=medium
9+
10+
[ max furman]
11+
* step ca commands
12+
13+
-- Smallstep Labs, Inc. <[email protected]> Fri, 28 Aug 2018 23:38:00 +0000
14+
615
step-cli (0.0.2-rc.12) UNRELEASED; urgency=medium
716

817
[ Mariano Cano ]

0 commit comments

Comments
 (0)