@@ -46,17 +46,25 @@ VERSION ?= $(shell [ -d .git ] && git describe --tags --always --dirty="-dev")
46
46
# If we are not in an active git dir then try reading the version from .VERSION.
47
47
# .VERSION contains a slug populated by `git archive`.
48
48
VERSION := $(or $(VERSION ) ,$(shell ./.version.sh .VERSION) )
49
+ ifeq ($(TRAVIS_BRANCH),master)
49
50
PUSHTYPE := master
51
+ else
52
+ PUSHTYPE := branch
53
+ endif
50
54
endif
51
55
52
56
VERSION := $(shell echo $(VERSION ) | sed 's/^v//')
57
+ DEB_VERSION := $(shell echo $(VERSION ) | sed 's/-/~/g')
53
58
54
59
ifdef V
55
60
$(info TRAVIS_TAG is $(TRAVIS_TAG))
56
61
$(info VERSION is $(VERSION))
62
+ $(info DEB_VERSION is $(DEB_VERSION))
57
63
$(info PUSHTYPE is $(PUSHTYPE))
58
64
endif
59
65
66
+ include make/docker.mk
67
+
60
68
# ########################################
61
69
# Build
62
70
# ########################################
@@ -134,13 +142,15 @@ lint:
134
142
135
143
INSTALL_PREFIX? =/usr/
136
144
137
- install : $(PREFIX ) bin/$(BINNAME ) $(PREFIX ) bin/$(CLOUDKMS_BINNAME )
145
+ install : $(PREFIX ) bin/$(BINNAME ) $(PREFIX ) bin/$(CLOUDKMS_BINNAME ) $( PREFIX ) bin/ $( AWSKMS_BINNAME )
138
146
$Q install -D $(PREFIX ) bin/$(BINNAME ) $(DESTDIR )$(INSTALL_PREFIX ) bin/$(BINNAME )
139
147
$Q install -D $(PREFIX ) bin/$(CLOUDKMS_BINNAME ) $(DESTDIR )$(INSTALL_PREFIX ) bin/$(CLOUDKMS_BINNAME )
148
+ $Q install -D $(PREFIX ) bin/$(AWSKMS_BINNAME ) $(DESTDIR )$(INSTALL_PREFIX ) bin/$(AWSKMS_BINNAME )
140
149
141
150
uninstall :
142
151
$Q rm -f $(DESTDIR )$(INSTALL_PREFIX ) /bin/$(BINNAME )
143
152
$Q rm -f $(DESTDIR )$(INSTALL_PREFIX ) /bin/$(CLOUDKMS_BINNAME )
153
+ $Q rm -f $(DESTDIR )$(INSTALL_PREFIX ) /bin/$(AWSKMS_BINNAME )
144
154
145
155
.PHONY : install uninstall
146
156
@@ -155,6 +165,12 @@ endif
155
165
ifneq ($(CLOUDKMS_BINNAME ) ,"")
156
166
$Q rm -f bin/$(CLOUDKMS_BINNAME)
157
167
endif
168
+ ifneq ($(AWSKMS_BINNAME ) ,"")
169
+ $Q rm -f bin/$(AWSKMS_BINNAME)
170
+ endif
171
+ ifneq ($(YUBIKEY_BINNAME ) ,"")
172
+ $Q rm -f bin/$(YUBIKEY_BINNAME)
173
+ endif
158
174
159
175
.PHONY : clean
160
176
@@ -167,82 +183,12 @@ run:
167
183
168
184
.PHONY : run
169
185
170
- # ########################################
171
- # Building Docker Image
172
- #
173
- # Builds a dockerfile for step by building a linux version of the step-cli and
174
- # then copying the specific binary when building the container.
175
- #
176
- # This ensures the container is as small as possible without having to deal
177
- # with getting access to private repositories inside the container during build
178
- # time.
179
- # ########################################
180
-
181
- # XXX We put the output for the build in 'output' so we don't mess with how we
182
- # do rule overriding from the base Makefile (if you name it 'build' it messes up
183
- # the wildcarding).
184
- DOCKER_OUTPUT =$(OUTPUT_ROOT ) docker/
185
-
186
- DOCKER_MAKE=V =$V GOOS_OVERRIDE='GOOS=linux GOARCH=amd64' PREFIX=$(1 ) make $(1 ) bin/$(2 )
187
- DOCKER_BUILD =$Q docker build -t smallstep/$(1 ) :latest -f docker/$(2 ) --build-arg BINPATH=$(DOCKER_OUTPUT ) bin/$(1 ) .
188
-
189
- docker : docker-make docker/Dockerfile.step-ca
190
- $(call DOCKER_BUILD,step-ca,Dockerfile.step-ca)
191
-
192
- docker-make :
193
- mkdir -p $(DOCKER_OUTPUT )
194
- $(call DOCKER_MAKE,$(DOCKER_OUTPUT ) ,step-ca)
195
-
196
- .PHONY : docker docker-make
197
-
198
- # ################################################
199
- # Releasing Docker Images
200
- #
201
- # Using the docker build infrastructure, this section is responsible for
202
- # logging into docker hub and pushing the built docker containers up with the
203
- # appropriate tags.
204
- # ################################################
205
-
206
- DOCKER_TAG =docker tag smallstep/$(1 ) :latest smallstep/$(1 ) :$(2 )
207
- DOCKER_PUSH =docker push smallstep/$(1 ) :$(2 )
208
-
209
- docker-tag :
210
- $(call DOCKER_TAG,step-ca,$(VERSION ) )
211
-
212
- docker-push-tag : docker-tag
213
- $(call DOCKER_PUSH,step-ca,$(VERSION ) )
214
-
215
- docker-push-tag-latest :
216
- $(call DOCKER_PUSH,step-ca,latest)
217
-
218
- # Rely on DOCKER_USERNAME and DOCKER_PASSWORD being set inside the CI or
219
- # equivalent environment
220
- docker-login :
221
- $Q docker login -u=" $( DOCKER_USERNAME) " -p=" $( DOCKER_PASSWORD) "
222
-
223
- .PHONY : docker-login docker-tag docker-push-tag docker-push-tag-latest
224
-
225
- # ################################################
226
- # Targets for pushing the docker images
227
- # ################################################
228
-
229
- # For all builds we build the docker container
230
- docker-master : docker
231
-
232
- # For all builds with a release candidate tag
233
- docker-release-candidate : docker-master docker-login docker-push-tag
234
-
235
- # For all builds with a release tag
236
- docker-release : docker-release-candidate docker-push-tag-latest
237
-
238
- .PHONY : docker-master docker-release-candidate docker-release
239
-
240
186
# ########################################
241
187
# Debian
242
188
# ########################################
243
189
244
190
changelog :
245
- $Q echo " step-certificates ($( VERSION ) ) unstable; urgency=medium" > debian/changelog
191
+ $Q echo " step-certificates ($( DEB_VERSION ) ) unstable; urgency=medium" > debian/changelog
246
192
$Q echo >> debian/changelog
247
193
$Q echo " * See https://github.com/smallstep/certificates/releases" >> debian/changelog
248
194
$Q echo >> debian/changelog
@@ -270,7 +216,7 @@ define BUNDLE_MAKE
270
216
# $(2) -- Go Architecture (e.g. amd64, arm, arm64, etc.)
271
217
# $(3) -- Go ARM architectural family (e.g. 7, 8, etc.)
272
218
# $(4) -- Parent directory for executables generated by 'make'.
273
- $(q ) GOOS_OVERRIDE='GOOS=$(1 ) GOARCH=$(2 ) GOARM=$(3 ) ' PREFIX=$(4 ) make $(4 ) bin/$(BINNAME ) $(4 ) bin/$(CLOUDKMS_BINNAME )
219
+ $(q ) GOOS_OVERRIDE='GOOS=$(1 ) GOARCH=$(2 ) GOARM=$(3 ) ' PREFIX=$(4 ) make $(4 ) bin/$(BINNAME ) $(4 ) bin/$(CLOUDKMS_BINNAME ) $( 4 ) bin/ $( AWSKMS_BINNAME )
274
220
endef
275
221
276
222
binary-linux :
@@ -290,16 +236,16 @@ define BUNDLE
290
236
# $(2) -- Step Platform Name
291
237
# $(3) -- Step Binary Architecture
292
238
# $(4) -- Step Binary Name (For Windows Comaptibility)
293
- $(q ) ./make/bundle.sh "$(BINARY_OUTPUT )$(1 ) " "$(RELEASE ) " "$(VERSION ) " "$(2 ) " "$(3 ) " "$(4 ) " "$(5 ) "
239
+ $(q ) ./make/bundle.sh "$(BINARY_OUTPUT )$(1 ) " "$(RELEASE ) " "$(VERSION ) " "$(2 ) " "$(3 ) " "$(4 ) " "$(5 ) " " $( 6 ) "
294
240
endef
295
241
296
242
bundle-linux : binary-linux binary-linux-arm64 binary-linux-armv7
297
- $(call BUNDLE,linux,linux,amd64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) )
298
- $(call BUNDLE,linux.arm64,linux,arm64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) )
299
- $(call BUNDLE,linux.armv7,linux,armv7,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) )
243
+ $(call BUNDLE,linux,linux,amd64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) , $( AWSKMS_BINNAME ) )
244
+ $(call BUNDLE,linux.arm64,linux,arm64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) , $( AWSKMS_BINNAME ) )
245
+ $(call BUNDLE,linux.armv7,linux,armv7,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) , $( AWSKMS_BINNAME ) )
300
246
301
247
bundle-darwin : binary-darwin
302
- $(call BUNDLE,darwin,darwin,amd64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) )
248
+ $(call BUNDLE,darwin,darwin,amd64,$(BINNAME ) ,$(CLOUDKMS_BINNAME ) , $( AWSKMS_BINNAME ) )
303
249
304
250
.PHONY : binary-linux binary-darwin bundle-linux bundle-darwin
305
251
@@ -323,6 +269,9 @@ artifacts-tag: artifacts-linux-tag artifacts-darwin-tag artifacts-archive-tag
323
269
# Targets for creating step artifacts
324
270
# ################################################
325
271
272
+ # For all builds that are not tagged and not on the master branch
273
+ artifacts-branch :
274
+
326
275
# For all builds that are not tagged
327
276
artifacts-master :
328
277
0 commit comments