mirror of https://gitlab.com/curben/blog
Apply patches immediately after 'npm install'
This commit is contained in:
parent
9ede298e68
commit
80140fa10b
|
@ -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
|
|
||||||
script:
|
|
||||||
- npm install -g hexo-cli snyk
|
- npm install -g hexo-cli snyk
|
||||||
- npm install
|
|
||||||
- snyk auth $SNYK_TOKEN
|
- 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:
|
||||||
|
|
Loading…
Reference in New Issue