frontend/.gitlab-ci.yml

58 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2020-03-07 09:54:42 +00:00
image: node:latest
stages:
- build
- test
- code_quality
- deploy
2020-03-07 09:54:42 +00:00
cache:
paths:
2020-03-07 14:12:52 +00:00
- smart-hut/node_modules/
2020-03-07 09:54:42 +00:00
install_dependencies:
stage: build
script:
2020-03-07 11:47:43 +00:00
- cd smart-hut
2020-03-07 12:07:32 +00:00
- yarn install
2020-03-07 09:54:42 +00:00
artifacts:
2020-03-07 11:42:57 +00:00
paths:
2020-03-07 14:12:52 +00:00
- smart-hut/node_modules/
2020-03-07 09:54:42 +00:00
testing_testing:
stage: test
script:
2020-03-07 11:47:43 +00:00
- cd smart-hut
- yarn test
sonar-scanner:
stage: code_quality
only:
- dev
script:
- cd smart-hut
- yarn eslint:report || true
- yarn sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.projectName=$CI_PROJECT_PATH_SLUG -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.exclusion=cypress -Dsonar.sources=src -Dsonar.javascript.file.suffixes=.js,.jsx -Dsonar.sourceEncoding=UTF-8 -Dsonar.scm.disabled=True -Dsonar.eslint.reportPaths=eslint-report.json
smartHut_deploy:
stage: deploy
2020-03-17 16:05:27 +00:00
tags:
- dind
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
before_script:
- docker version
- docker info
- docker login -u smarthutsm -p $CI_DOCKER_PASS #GiovanniRoberto
script:
- "docker build -t smarthutsm/smarthut:${CI_COMMIT_BRANCH} ."
- "docker push smarthutsm/smarthut:${CI_COMMIT_BRANCH}"
after_script:
- docker logout
only:
- dev
- master