@@ -120,13 +120,8 @@ ci-lint:
120
120
prep : fmtcheck
121
121
@sh -c " '$( CURDIR) /scripts/goversioncheck.sh' '$( GO_VERSION_MIN) '"
122
122
@$(GO_CMD ) generate $($(GO_CMD ) list ./... | grep -v /vendor/)
123
- @# Remove old (now broken) husky git hooks.
124
- @[ ! -d .git/hooks ] || grep -l ' ^# husky$$' .git/hooks/* | xargs rm -f
125
123
@if [ -d .git/hooks ]; then cp .hooks/* .git/hooks/; fi
126
124
127
- PACKAGES_LOCK_DIR := $(shell find . -mindepth 1 -maxdepth 1 \
128
- -type d -name 'packages* .lock')
129
-
130
125
# bootstrap the build by downloading additional tools needed to build
131
126
ci-bootstrap :
132
127
@for tool in $(EXTERNAL_TOOLS_CI ) ; do \
@@ -249,76 +244,14 @@ hana-database-plugin:
249
244
mongodb-database-plugin :
250
245
@CGO_ENABLED=0 $(GO_CMD ) build -o bin/mongodb-database-plugin ./plugins/database/mongodb/mongodb-database-plugin
251
246
252
- # WRITE_GENERATED_FILE_HEADER overwrites the file specified, replacing its contents with
253
- # the header warning people not to attempt to edit or merge the file. You should call this
254
- # before writing the generated contents to the file.
255
- # Args: 1: File to write; 2: Command to generate it; 3: Source files to edit/merge instead.
256
- define WRITE_GENERATED_FILE_HEADER
257
- echo "# ## ***" > $(1); \
258
- echo "### WARNING: DO NOT manually EDIT or MERGE this file, it is generated by '$(2)'." >> $(1); \
259
- echo "### INSTEAD: Edit or merge the source in $(3) then run '$(2)'." >> $(1); \
260
- echo "### ***" >> $(1)
261
- endef
262
-
263
- # # begin packagespec integration ##
264
-
265
- # The plan is to generate this packagespec integration section automatically.
266
- # By keeping it in a contiguous block for now, it will be easier to
267
- # auto-generate when we get to it.
268
-
269
- SPEC_FILE_PATTERN := packages*.yml
270
- # SPEC is the human-managed description of which packages we are able to build.
271
- SPEC := $(shell find . -mindepth 1 -maxdepth 1 -name '$(SPEC_FILE_PATTERN ) ')
272
- ifneq ($(words $(SPEC ) ) ,1)
273
- $(error Found $(words $(SPEC ) ) $(SPEC_FILE_PATTERN ) files, need exactly 1 : $(SPEC ) )
274
- endif
275
- SPEC_FILENAME := $(notdir $(SPEC ) )
276
- SPEC_MODIFIER := $(SPEC_FILENAME:packages%.yml=% )
277
- # LOCKDIR contains the lockfile and layer files.
278
- LOCKDIR := packages$(SPEC_MODIFIER ) .lock
279
- LOCKFILE := $(LOCKDIR ) /pkgs.yml
280
-
281
- export PACKAGE_SPEC_ID LAYER_SPEC_ID PRODUCT_REVISION PRODUCT_VERSION
282
-
283
- # PACKAGESPEC_TARGETS are convenience aliases for targets defined in $(LOCKDIR)/Makefile
284
- PACKAGESPEC_TARGETS := \
285
- build build-all build-ci \
286
- aliases meta package \
287
- package-meta stage-config stage \
288
- watch-ci publish-config publish list-staged-builds
289
-
290
- $(PACKAGESPEC_TARGETS ) :
291
- @PRODUCT_REPO_ROOT=" $( shell git rev-parse --show-toplevel) " $(MAKE ) -C $(LOCKDIR ) $@
292
-
293
- # packages regenerates $(LOCKDIR) from $(SPEC) using packagespec. This is only for
294
- # internal HashiCorp use, as it has dependencies not available to OSS contributors.
295
- packages :
296
- @command -v packagespec > /dev/null 2>&1 || { \
297
- echo " Please install packagespec." ; \
298
- echo " Note: packagespec is only available to HashiCorp employees at present." ; \
299
- exit 1; \
300
- }
301
- @packagespec lock -specfile $(SPEC ) -lockdir $(LOCKDIR )
302
- @$(MAKE ) ci-config
303
-
304
- .PHONY : $(PACKAGESPEC_TARGETS ) packages
305
- # # end packagespec integration ##
247
+ # Tell packagespec where to write its CircleCI config.
248
+ PACKAGESPEC_CIRCLECI_CONFIG := .circleci/config/@build-release.yml
306
249
307
- CI_WORKFLOW_TPL := .circleci/config/@build-release.yml.tpl
308
- CI_WORKFLOW := .circleci/config/@build-release.yml
309
-
310
- .PHONY : ci-update-release-packages $(CI_WORKFLOW )
311
- ci-update-release-packages : $(CI_WORKFLOW )
312
- @echo $^
313
-
314
- $(CI_WORKFLOW ) : $(LOCKFILE ) $(CI_WORKFLOW_TPL )
315
- @\
316
- echo " ==> Updating $@ to match $<" ; \
317
- $(call WRITE_GENERATED_FILE_HEADER,$@ ,make $@ ,$^ ) ; \
318
- cat $< | gomplate -f $(CI_WORKFLOW_TPL ) -d ' package-list=stdin://?type=application/yaml' >> $@
250
+ # Tell packagespec to re-run 'make ci-config' whenever updating its own CI config.
251
+ PACKAGESPEC_HOOK_POST_CI_CONFIG := $(MAKE ) ci-config
319
252
320
253
.PHONY : ci-config
321
- ci-config : ci-update-release-packages
254
+ ci-config : $( PACKAGESPEC_CIRCLECI_CONFIG )
322
255
@$(MAKE ) -C .circleci ci-config
323
256
.PHONY : ci-verify
324
257
ci-verify :
@@ -327,3 +260,5 @@ ci-verify:
327
260
.PHONY : bin default prep test vet bootstrap ci-bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin static-assets ember-dist ember-dist-dev static-dist static-dist-dev assetcheck check-vault-in-path check-browserstack-creds test-ui-browserstack packages build build-ci
328
261
329
262
.NOTPARALLEL : ember-dist ember-dist-dev static-assets
263
+
264
+ -include packagespec.mk
0 commit comments