You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.8 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. MONOREPO_PATH ?= ../../cucumber
  2. # https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
  3. rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
  4. RUBY_FILES=$(call rwildcard,../lib ../../cucumber-ruby-core/lib/,*.rb)
  5. FEATURES = $(sort $(wildcard features/docs/**.feature))
  6. GOLDEN_JSONS = $(patsubst features/docs/%.feature,acceptance/%-golden.json,$(FEATURES))
  7. GENERATED_JSONS = $(patsubst features/docs/%.feature,acceptance/%-generated.json,$(FEATURES))
  8. TESTED = $(patsubst features/docs/%.feature,acceptance/%.tested,$(FEATURES))
  9. OS := $(shell [[ "$$(uname)" == "Darwin" ]] && echo "darwin" || echo "linux")
  10. # Determine if we're on 386 or amd64 (ignoring other processors as we're not building on them)
  11. ARCH := $(shell [[ "$$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "386")
  12. default: $(GOLDEN_JSONS) $(GENERATED_JSONS) $(TESTED)
  13. .PHONY: default
  14. acceptance/%.tested: acceptance/%-golden.json acceptance/%-generated.json
  15. mkdir -p $$(dirname $@)
  16. diff --unified $^
  17. .PHONY: acceptance/%.tested
  18. acceptance/%-golden.json: features/docs/%.feature $(MONOREPO_PATH)/compatibility-kit/ruby/scripts/neutralize-json $(RUBY_FILES)
  19. mkdir -p $$(dirname $@)
  20. bundle exec cucumber --format=json $< | \
  21. jq --sort-keys "." | \
  22. $(MONOREPO_PATH)/compatibility-kit/ruby/scripts/neutralize-json > $@
  23. acceptance/%-generated.json: features/docs/%.feature $(RUBY_FILES) bin/json-formatter $(MONOREPO_PATH)/compatibility-kit/ruby/scripts/neutralize-json
  24. mkdir -p $$(dirname $@)
  25. bundle exec cucumber --format=message $< | \
  26. bin/json-formatter --format ndjson | \
  27. jq --sort-keys "." | \
  28. $(MONOREPO_PATH)/compatibility-kit/ruby/scripts/neutralize-json > $@
  29. bin/json-formatter: $(MONOREPO_PATH)/json-formatter/go/dist/cucumber-json-formatter-$(OS)-$(ARCH)
  30. cp $(MONOREPO_PATH)/json-formatter/go/dist/cucumber-json-formatter-$(OS)-$(ARCH) $@
  31. chmod +x $@
  32. clean:
  33. rm -rf acceptance/*.json bin/json-formatter
  34. .PHONY: clean
  35. release:
  36. [ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
  37. git -C ../secrets pull
  38. ../secrets/update_permissions
  39. docker run \
  40. --volume "${shell pwd}":/app \
  41. --volume "${shell pwd}/../secrets/import-gpg-key.sh":/home/cukebot/import-gpg-key.sh \
  42. --volume "${shell pwd}/../secrets/codesigning.key":/home/cukebot/codesigning.key \
  43. --volume "${shell pwd}/../secrets/.ssh":/home/cukebot/.ssh \
  44. --volume "${shell pwd}/../secrets/.gem":/home/cukebot/.gem \
  45. --volume "${HOME}/.gitconfig":/home/cukebot/.gitconfig \
  46. --env CUCUMBER_USE_RELEASED_GEMS=1 \
  47. --env-file ../secrets/secrets.list \
  48. --user 1000 \
  49. --rm \
  50. -it cucumber/cucumber-build:latest \
  51. bash -c "rm Gemfile.lock && bundle && bundle exec rake && bundle exec rake release"
  52. .PHONY: release

No Description

Contributors (1)