Skip to content

Instantly share code, notes, and snippets.

@g-dormoy
Created May 23, 2017 11:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g-dormoy/592777b0c9da7f73653f8bdb9596a495 to your computer and use it in GitHub Desktop.
Save g-dormoy/592777b0c9da7f73653f8bdb9596a495 to your computer and use it in GitHub Desktop.
image: node:7.6.0
cache:
paths:
- node_modules/
stages:
- test
- style
- build
- deploy
unit_test:
stage: test
script:
- npm install
- npm run unit
e2e_test:
stage: test
script:
# Install Chrome
- set -xe
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- apt-get update -yqqq
# Install java with the requiered version
- apt-get install -y software-properties-common
- add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
- apt-get update
# Force Yes on java license prompt
- echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
- echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
# Install all the things
- apt-get install -y google-chrome-stable xvfb oracle-java8-installer
- xvfb-run -a npm run e2e
lint:
stage: style
script:
- npm run lint
build:
stage: build
image: node:latest
script:
- npm run build
artifacts:
paths:
- dist/
deploy_staging:
environment: staging
stage: deploy
image: python:latest
dependencies:
- build
script:
- pip install awscli
- ls
- aws s3 cp ./dist s3://$S3_STAGING_BUCKET_NAME --recursive --region eu-west-2
except:
- master
deploy:
environment: production
stage: deploy
image: python:latest
dependencies:
- build
script:
- pip install awscli
- ls
- aws s3 cp ./dist s3://$S3_BUCKET_NAME --recursive --region eu-west-2
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment