mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 22:21:45 +08:00
+1
-1
@@ -15,7 +15,7 @@
|
||||
There are some runtime requirements for running Talk from source:
|
||||
|
||||
- [Node](https://nodejs.org/) v7 or later
|
||||
- [MongoDB](https://www.mongodb.com/) v3.2 or later
|
||||
- [MongoDB](https://www.mongodb.com/) v3.4 or later
|
||||
- [Redis](https://redis.io/) v3.2 or later
|
||||
- [Yarn](https://yarnpkg.com/) v0.19.1 or later
|
||||
|
||||
|
||||
+69
-40
@@ -1,45 +1,74 @@
|
||||
machine:
|
||||
node:
|
||||
version: 7
|
||||
services:
|
||||
- docker
|
||||
- redis
|
||||
environment:
|
||||
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
|
||||
NODE_ENV: "test"
|
||||
version: 2
|
||||
|
||||
dependencies:
|
||||
override:
|
||||
- yarn
|
||||
cache_directories:
|
||||
- ~/.cache/yarn
|
||||
post:
|
||||
# Build the static assets
|
||||
- yarn build
|
||||
# Lint the project here, before tests are ran.
|
||||
- yarn lint
|
||||
containerInfo:
|
||||
- image: node:7
|
||||
- image: mongo:3.4
|
||||
- image: redis:3.2
|
||||
|
||||
database:
|
||||
post:
|
||||
# Initialize the settings in the database, this will create indicies for the
|
||||
# database.
|
||||
- ./bin/cli setup --defaults
|
||||
- sleep 2
|
||||
stages:
|
||||
build:
|
||||
workDir: ~/talk
|
||||
environment:
|
||||
- "PATH=$PATH:~/talk/node_modules/.bin"
|
||||
- "NODE_ENV=test"
|
||||
steps:
|
||||
# Get the code
|
||||
- type: checkout
|
||||
|
||||
test:
|
||||
override:
|
||||
# Run the tests using the junit reporter.
|
||||
- MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml MOCHA_REPORTER=mocha-junit-reporter yarn test
|
||||
# Run the e2e test suite
|
||||
- E2E_REPORT_PATH=$CIRCLE_TEST_REPORTS/e2e yarn e2e
|
||||
# Restore the yarn cache
|
||||
- type: cache-restore
|
||||
key: yarn-cache
|
||||
|
||||
deployment:
|
||||
release:
|
||||
tag: /v[0-9]+(\.[0-9]+)*/
|
||||
commands:
|
||||
- bash ./scripts/deploy.sh
|
||||
# Install dependencies
|
||||
- type: shell
|
||||
shell: /bin/bash
|
||||
command: |
|
||||
# install yarn
|
||||
npm install -g yarn
|
||||
|
||||
latest:
|
||||
branch: master
|
||||
commands:
|
||||
- bash ./scripts/deploy.sh
|
||||
# install dependencies
|
||||
yarn
|
||||
|
||||
# Save the yarn cache
|
||||
- type: cache-save
|
||||
key: yarn-cache
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
|
||||
# Build the dependencies
|
||||
- type: shell
|
||||
shell: /bin/bash
|
||||
command: |
|
||||
# build static dependencies
|
||||
yarn build
|
||||
|
||||
# lint the project
|
||||
yarn lint
|
||||
|
||||
- type: shell
|
||||
shell: /bin/bash
|
||||
command: |
|
||||
# Initialize the settings in the database, this will create indicies
|
||||
# for the database.
|
||||
./bin/cli setup --defaults
|
||||
|
||||
# Ugly fix to wait until database indicies are created.
|
||||
sleep 2
|
||||
|
||||
# Run the tests using the junit reporter.
|
||||
MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml MOCHA_REPORTER=mocha-junit-reporter yarn test
|
||||
|
||||
# Run the e2e test suite
|
||||
E2E_REPORT_PATH=$CIRCLE_TEST_REPORTS/e2e yarn e2e
|
||||
|
||||
# TODO: fix
|
||||
# deployment:
|
||||
# release:
|
||||
# tag: /v[0-9]+(\.[0-9]+)*/
|
||||
# commands:
|
||||
# - bash ./scripts/deploy.sh
|
||||
#
|
||||
# latest:
|
||||
# branch: master
|
||||
# commands:
|
||||
# - bash ./scripts/deploy.sh
|
||||
|
||||
Reference in New Issue
Block a user