Pin Frey as a dependency vs installing latest globally

This commit is contained in:
Kevin van Zonneveld 2016-12-20 13:42:06 +01:00
parent 2d187c00aa
commit cc78da7de5
4 changed files with 1290 additions and 4 deletions

40
.infra/Makefile Normal file
View File

@ -0,0 +1,40 @@
# Licensed under MIT.
# Copyright (2016) by Kevin van Zonneveld https://twitter.com/kvz
#
# https://www.npmjs.com/package/fakefile
#
# This Makefile offers convience shortcuts into any Node.js project that utilizes npm scripts.
# It functions as a wrapper around the actual listed in `package.json`
# So instead of typing:
#
# $ npm script build:assets
#
# you could also type:
#
# $ make build-assets
#
# Notice that colons (:) are replaced by dashes for Makefile compatibility.
#
# The benefits of this wrapper are:
#
# - You get to keep the the scripts package.json, which is more portable
# (Makefiles & Windows are harder to mix)
# - Offer a polite way into the project for developers coming from different
# languages (npm scripts is obviously very Node centric)
# - Profit from better autocomplete (make <TAB><TAB>) than npm currently offers.
# OSX users will have to install bash-completion
# (http://davidalger.com/development/bash-completion-on-os-x-with-brew/)
define npm_script_targets
TARGETS := $(shell node -e 'for (var k in require("./package.json").scripts) {console.log(k.replace(/:/g, "-"));}')
$$(TARGETS):
npm run $(subst -,:,$(MAKECMDGOALS))
.PHONY: $$(TARGETS)
endef
$(eval $(call npm_script_targets))
# These npm run scripts are available, without needing to be mentioned in `package.json`
install:
npm run install

14
.infra/package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "tusd-infra",
"version": "0.0.1",
"description": "This folder is charge of launching master.tus.io via [Frey](https://github.com/kvz/frey). You could re-use bits of this, but you could also run tusd any other way you want. It's not a requirement for running a tusd server.",
"dependencies": {
"frey": "0.3.27"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT"
}

1232
.infra/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ maketar linux amd64
cp ./tusd_linux_amd64.tar.gz "${__dir}/../.infra/files/"
which frey || npm install -g frey
FREY="$(which frey)"
$FREY --projectDir "${__dir}/../.infra" --force-yes deploy
pushd "${__dir}/../.infra"
yarn || npm install
./node_modules/.bin/frey --force-yes deploy
popd