converter/.gitlab-ci.yml
Manuel Friedli 77a79bf588 Added a first simple test.
That serves as a proof-of-concept and as a template for future tests.
It's a start!
2017-03-15 02:22:24 +01:00

57 lines
1 KiB
YAML

stages:
- build
- cleanup_build
- deploy
- cleanup
build_job:
stage: build
script:
- npm install
- npm run build
- npm run test
tags:
- javascript
except:
- tags
artifacts:
paths:
- dist
expire_in: 30 min
cleanup_build_job:
stage: cleanup_build
script:
- rm -rf node_modules
- rm -rf dist
when: on_failure
pages:
stage: deploy
environment: staging
except:
- tags
- master
script:
- mv dist public
artifacts:
paths:
- public
dependencies:
- build_job
production:
stage: deploy
environment: production
only:
- master
script:
- if [[ -z "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then echo "WWW_DEPLOY_ROOT_PRODUCTION is not set" ; exit 1 ; fi
- if [[ ! -d "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then mkdir -p "${WWW_DEPLOY_ROOT_PRODUCTION}" || die "Failed to create target directory for deployment!" ; fi
- cp dist/* "${WWW_DEPLOY_ROOT_PRODUCTION}"
cleanup_job:
stage: cleanup
script:
- rm -rf node_modules
when: always