Skip to content

Instantly share code, notes, and snippets.

@peleteiro
Created July 22, 2017 00:13
Show Gist options
  • Save peleteiro/c56800cb933f843eb03f68bc0368e159 to your computer and use it in GitHub Desktop.
Save peleteiro/c56800cb933f843eb03f68bc0368e159 to your computer and use it in GitHub Desktop.
version: 2
jobs:
build:
working_directory: /srv/biblebox
environment:
DISPLAY: :99
BIBLEBOX_DATA_PATH: /srv/biblebox-data
BIBLEBOX_SEARCH_ENDPOINT: http://127.0.0.1:1234
BIBLEBOX_DATA_ENDPOINT: http://127.0.0.1:2345
TESTCAFE_CLI_XTRS: --app-init-delay 6000 --no-color --reporter list
docker:
- image: biblebox/ci:2017-05-29_13-50-05
steps:
- checkout
- restore_cache:
key: search-{{ .Branch }}-{{ checksum "search/build.sbt" }}
- run:
name: Search - Dependencies install
command: |
cd search
sbt update -batch
- save_cache:
key: search-{{ .Branch }}-{{ checksum "search/build.sbt" }}
paths:
- ".ivy2"
- run:
name: Search - Compile server
command: |
cd search
make build
- run:
name: Search - Run server
background: true
command: PORT=1234 java -jar search/target/scala-2.12/biblebox-search-server.jar
- run:
name: Data - Run server
background: true
command: |
echo ":2345 {" > Caddyfile
echo " root /srv/biblebox-data/public" >> Caddyfile
echo " tls off" >> Caddyfile
echo " cors" >> Caddyfile
echo "}" >> Caddyfile
caddy
- restore_cache:
key: site-{{ .Branch }}-{{ checksum "site/yarn.lock" }}
- run:
name: Site - Dependencies install
command: |
cd site
yarn
npm rebuild
- save_cache:
key: site-{{ .Branch }}-{{ checksum "site/yarn.lock" }}
paths:
- "site/node_modules"
- run:
name: Site - Lint
command: |
cd site
make lint
- run:
name: Site - Compile
command: |
cd site
make build
- run:
name: Site - Jest tests
command: |
cd site
make test
- run:
name: Start xvfb
background: true
command: Xvfb :99 -screen 0 1280x1024x24
- run:
name: Site - Start dev server
background: true
command: |
cd site
make dev
- run:
name: Site - Browser tests
command: |
cd site
stty cols 120
sleep 10
make test-browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment