2016-08-15 20:28:23 +02:00
|
|
|
stages:
|
2016-09-15 21:32:14 +02:00
|
|
|
- build
|
|
|
|
- cleanup_build
|
2017-03-07 04:16:22 +01:00
|
|
|
- deploy
|
2016-09-15 23:40:44 +02:00
|
|
|
# - cleanup
|
2016-08-15 20:28:23 +02:00
|
|
|
|
|
|
|
.run_deploy: &run_deploy
|
|
|
|
script:
|
|
|
|
- chmod +x ./deploy.sh
|
2017-03-14 00:50:14 +01:00
|
|
|
- ./deploy.sh
|
2017-03-07 04:16:22 +01:00
|
|
|
# dependencies:
|
|
|
|
# - build_job
|
2016-08-15 20:28:23 +02:00
|
|
|
|
2016-09-15 21:32:14 +02:00
|
|
|
build_job:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- npm install
|
2017-03-14 17:39:09 +01:00
|
|
|
- npm run build
|
2016-09-15 21:32:14 +02:00
|
|
|
tags:
|
|
|
|
- javascript
|
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2017-03-14 17:39:09 +01:00
|
|
|
- dist
|
2016-09-21 02:31:42 +02:00
|
|
|
expire_in: 30 min
|
2016-08-15 20:28:23 +02:00
|
|
|
|
2016-09-15 21:32:14 +02:00
|
|
|
cleanup_build_job:
|
|
|
|
stage: cleanup_build
|
|
|
|
script:
|
|
|
|
- rm -rf node_modules
|
2017-03-14 17:39:09 +01:00
|
|
|
- rm -rf dist
|
2016-09-15 21:32:14 +02:00
|
|
|
when: on_failure
|
2016-08-15 20:28:23 +02:00
|
|
|
|
2017-03-07 04:12:52 +01:00
|
|
|
pages:
|
2017-03-14 00:21:43 +01:00
|
|
|
stage: deploy
|
|
|
|
environment: staging
|
2017-03-07 04:12:52 +01:00
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
- master
|
|
|
|
script:
|
2017-03-14 17:39:09 +01:00
|
|
|
- mv dist public
|
2017-03-07 04:12:52 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
dependencies:
|
|
|
|
- build_job
|
|
|
|
|
2016-08-15 20:28:23 +02:00
|
|
|
production:
|
|
|
|
stage: deploy
|
|
|
|
<<: *run_deploy
|
|
|
|
environment: production
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
variables:
|
|
|
|
ENVIRON: production
|
|
|
|
TARGET: $WWW_DEPLOY_ROOT_PRODUCTION
|
|
|
|
|
2016-09-15 23:40:44 +02:00
|
|
|
#cleanup_job:
|
|
|
|
# stage: cleanup
|
|
|
|
# script:
|
|
|
|
# - rm -rf node_modules
|
|
|
|
# - rm -rf typings
|
|
|
|
# when: always
|