Apply patches immediately after 'npm install'

This commit is contained in:
curben 2018-09-25 10:44:40 +09:30
parent 9ede298e68
commit 80140fa10b
1 changed files with 6 additions and 11 deletions

View File

@ -2,7 +2,6 @@
image: node:latest image: node:latest
stages: stages:
- build
- test - test
- deploy - deploy
@ -10,26 +9,22 @@ cache: # add cache to 'node_modules' for speeding up builds
paths: paths:
- node_modules/ # Node modules and dependencies - node_modules/ # Node modules and dependencies
build-job: before_script: # install tools before jobs
stage: build - npm install -g hexo-cli snyk
script: - snyk auth $SNYK_TOKEN
- npm install -g hexo-cli snyk
- npm install
- snyk auth $SNYK_TOKEN
only:
- master # job will affect only the 'master' branch
snyk-test: snyk-test:
stage: test stage: test
script: script:
- snyk test # Test node modules for vulnerability - npm install # install node modules
- snyk protect # Apply patches to node modules
- snyk test # Verify node modules for vulnerability
only: only:
- master - master
pages: pages:
stage: deploy stage: deploy
script: script:
- snyk protect # Apply patches to node modules
- hexo deploy # deploy the site - hexo deploy # deploy the site
- find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \; # Compress files - find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \; # Compress files
artifacts: artifacts: