-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Stockdale
committed
Aug 21, 2018
1 parent
7426fbe
commit 43f5212
Showing
4 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
################ | ||
# Entry Points # | ||
################ | ||
.PHONY: test | ||
|
||
publish-patch: | ||
docker-compose run --rm node make _devdeps _release-patch _clean _publish | ||
|
||
publish-minor: | ||
docker-compose run --rm node make _devdeps _release-minor _clean _publish | ||
|
||
publish-major: | ||
docker-compose run --rm node make _devdeps _release-major _clean _publish | ||
|
||
test: | ||
docker-compose run --rm node make _devdeps _testUnitWithCoverage | ||
|
||
shell: | ||
docker-compose run --rm node bash | ||
|
||
|
||
########## | ||
# Others # | ||
########## | ||
|
||
_test: | ||
npm test | ||
|
||
_testUnitWithCoverage: | ||
npm run cover | ||
|
||
_deps: | ||
npm install --production | ||
|
||
_devdeps: | ||
npm install | ||
|
||
_clean: | ||
rm -fr node_modules | ||
|
||
define release | ||
VERSION=`node -pe "require('./package.json').version"` && \ | ||
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \ | ||
node -e "\ | ||
var j = require('./package.json');\ | ||
j.version = \"$$NEXT_VERSION\";\ | ||
var s = JSON.stringify(j, null, 2);\ | ||
require('fs').writeFileSync('./package.json', s);" | ||
endef | ||
|
||
_release-patch: _test _adduser | ||
@$(call release,patch) | ||
|
||
_release-minor: _test _adduser | ||
@$(call release,minor) | ||
|
||
_release-major: _test _adduser | ||
@$(call release,major) | ||
|
||
_adduser: | ||
npm adduser | ||
|
||
_publish: | ||
npm publish --access public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '0.1' | ||
|
||
services: | ||
|
||
node: | ||
image: node:latest | ||
volumes: | ||
- .:/opt/app | ||
working_dir: /opt/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters