Use local package only and replace 'latest' with version number

https://firstdoit.com/no-need-for-globals-using-npm-dependencies-in-npm-scripts-3dfb478908?gi=9f1ea80a068
Specify 'latest' doesn't necessarily install the latest version
https://stackoverflow.com/a/39650983
This commit is contained in:
curben 2018-10-26 17:49:15 +10:30
parent 8f236bd28f
commit 0e7fbcbd0b
3 changed files with 20 additions and 20 deletions

View File

@ -6,12 +6,8 @@ test:
- node_modules/ # Node modules and dependencies - node_modules/ # Node modules and dependencies
script: script:
- npm install -g snyk hexo-cli - npm install
- npm install # install node modules - npm run build
- snyk auth $SNYK_TOKEN
- snyk protect # Apply patches to node modules
- snyk test # Check node modules for vulnerability
- hexo generate # Generate static files for debugging
only: only:
- master # this job will affect only the 'master' branch - master # this job will affect only the 'master' branch

View File

@ -1,6 +1,6 @@
[context.production] [context.production]
publish = "public" publish = "public"
command = "snyk auth $SNYK_TOKEN && snyk protect && snyk test && hexo generate" command = "npm run build"
[[headers]] [[headers]]
for = "/*" for = "/*"

View File

@ -5,18 +5,22 @@
"hexo": { "hexo": {
"version": "3.8.0" "version": "3.8.0"
}, },
"scripts": {
"build": "snyk auth $SNYK_TOKEN && snyk protect && snyk test && hexo generate"
},
"dependencies": { "dependencies": {
"hexo": "latest", "hexo": "^3.8.0",
"hexo-nofollow": "latest", "hexo-cli": "^1.1.0",
"hexo-generator-archive": "latest", "hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "latest", "hexo-generator-category": "^0.1.3",
"hexo-generator-index": "latest", "hexo-generator-index": "^0.2.1",
"hexo-generator-tag": "latest", "hexo-generator-tag": "^0.2.0",
"hexo-renderer-ejs": "latest", "hexo-nofollow": "^1.0.2",
"hexo-renderer-marked": "latest", "hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-stylus": "latest", "hexo-renderer-marked": "^0.3.2",
"hexo-server": "latest", "hexo-renderer-stylus": "^0.3.3",
"hexo-yam": "latest", "hexo-server": "^0.3.3",
"snyk": "latest" "hexo-yam": "^1.0.2",
"snyk": "^1.105.0"
} }
} }