converter/.gitlab-ci.yml

79 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2016-08-15 20:28:23 +02:00
stages:
- build
- cleanup_build
2017-03-07 04:16:22 +01:00
- deploy
- cleanup
2016-08-15 20:28:23 +02:00
2017-11-07 23:40:50 +01:00
#build_job:
# stage: build
# script:
# - yarn install
# - yarn run build
# - yarn run lint
# - yarn run test
# - yarn run e2e
# tags:
# - javascript
# except:
# - tags
# - master
# artifacts:
# paths:
# - dist
# expire_in: 30 min
build_job_production:
stage: build
script:
- yarn install
- yarn run build-prod
- yarn run lint
# - yarn run test
# - yarn run e2e
tags:
- javascript
2017-11-07 23:40:50 +01:00
# only:
# - master
artifacts:
paths:
- dist
expire_in: 30 min
2016-08-15 20:28:23 +02:00
cleanup_build_job:
stage: cleanup_build
script:
- rm -rf node_modules
- rm -rf dist
when: on_failure
2016-08-15 20:28:23 +02:00
2017-03-07 04:12:52 +01:00
pages:
stage: deploy
environment: staging
2017-03-07 04:12:52 +01:00
except:
- tags
- master
script:
- mv dist public
2017-03-07 04:12:52 +01:00
artifacts:
paths:
- public
dependencies:
2017-11-08 00:00:24 +01:00
- build_job_production
2017-03-07 04:12:52 +01:00
2016-08-15 20:28:23 +02:00
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
- rm -rf "${WWW_DEPLOY_ROOT_PRODUCTION}"/* || die "Failed to clean old deployment"
2017-03-15 02:47:27 +01:00
- cp -r dist/* "${WWW_DEPLOY_ROOT_PRODUCTION}"
2016-08-15 20:28:23 +02:00
cleanup_job:
stage: cleanup
script:
- rm -rf node_modules
when: always