Commit 493de448 authored by Mathew Parker's avatar Mathew Parker

Add test/build/deploy stages to pipeline

Whenever you push to remote now, the CI server will:
1. install repo dependencies
2. do tests (currently just linting)
3. do a build

Whenever a merge to master occurs, apparently there is a way to manually
trigger the 'deploy' stage, which we will make.

That stage will do a recursive copy / rsync to another location,
wherever nn.adamprocter.co.uk is being hosted, possibly the same machine
even. After copying, it'll run 'yarn serve' and our prod site will
receive the fresh copy of master and be fully updated.

Eventually, I'd like to have that part run in duplicate / haproxy, so we
can take one half down and update it, while the other half is still up.
No downtime during deploys.
parent df06f4b5
Pipeline #64 passed with stages
in 4 minutes and 38 seconds
node_modules/.cache/*
/node_modules/.cache/*
node_modules/.cache/
*.swp
stages:
- install
- test
- build
- deploy
cache:
paths:
- node_modules/
- .yarn
install_dependencies:
stage: build
dependencies:
stage: install
script:
- echo "Installing dependencies"
- yarn install
artifacts:
paths:
- node_modules/
lint:
stage: build
stage: test
script:
- echo "Running eslint"
- yarn run lint
artifacts:
paths:
- node_modules/
build:
stage: build
script:
- echo "Building minified production app"
- yarn run build
artifacts:
paths:
- node_modules/
production_server:
stage: deploy
script:
- echo "Deploying to production server"
environment:
name: production
url: http://nn.adamprocter.co.uk
when: manual
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment