Should now run frontend tests on gitlab
This commit is contained in:
parent
f7d876aec6
commit
cb2238c576
|
@ -2,7 +2,7 @@ variables:
|
||||||
IMAGE_NAME: funkwhale/funkwhale
|
IMAGE_NAME: funkwhale/funkwhale
|
||||||
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
|
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
|
||||||
IMAGE_LATEST: $IMAGE_NAME:latest
|
IMAGE_LATEST: $IMAGE_NAME:latest
|
||||||
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
|
||||||
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
@ -14,40 +14,61 @@ test_api:
|
||||||
services:
|
services:
|
||||||
- postgres:9.4
|
- postgres:9.4
|
||||||
stage: test
|
stage: test
|
||||||
image: funkwhale/funkwhale:base
|
image: funkwhale/funkwhale:latest
|
||||||
|
cache:
|
||||||
|
key: "$CI_PROJECT_ID/pip_cache"
|
||||||
|
paths:
|
||||||
|
- "$PIP_CACHE_DIR"
|
||||||
variables:
|
variables:
|
||||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
|
|
||||||
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- python3 -m venv --copies virtualenv
|
|
||||||
- source virtualenv/bin/activate
|
|
||||||
- cd api
|
- cd api
|
||||||
- pip install -r requirements/base.txt
|
- pip install -r requirements/base.txt
|
||||||
- pip install -r requirements/local.txt
|
- pip install -r requirements/local.txt
|
||||||
- pip install -r requirements/test.txt
|
- pip install -r requirements/test.txt
|
||||||
script:
|
script:
|
||||||
- pytest
|
- pytest
|
||||||
cache:
|
|
||||||
key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
|
|
||||||
paths:
|
|
||||||
- "$CI_PROJECT_DIR/pip-cache"
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
build_front:
|
|
||||||
stage: build
|
test_front:
|
||||||
image: node:6-alpine
|
stage: test
|
||||||
|
image: node:9
|
||||||
before_script:
|
before_script:
|
||||||
- cd front
|
- cd front
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm install
|
- yarn install
|
||||||
- npm run build
|
- yarn run unit
|
||||||
cache:
|
cache:
|
||||||
key: "$CI_COMMIT_REF_NAME"
|
key: "$CI_PROJECT_ID/front_dependencies"
|
||||||
paths:
|
paths:
|
||||||
- front/node_modules
|
- front/node_modules
|
||||||
|
- front/yarn.lock
|
||||||
|
artifacts:
|
||||||
|
name: "front_${CI_COMMIT_REF_NAME}"
|
||||||
|
paths:
|
||||||
|
- front/dist/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
|
||||||
|
build_front:
|
||||||
|
stage: build
|
||||||
|
image: node:9
|
||||||
|
before_script:
|
||||||
|
- cd front
|
||||||
|
|
||||||
|
script:
|
||||||
|
- yarn install
|
||||||
|
- yarn run build
|
||||||
|
cache:
|
||||||
|
key: "$CI_PROJECT_ID/front_dependencies"
|
||||||
|
paths:
|
||||||
|
- front/node_modules
|
||||||
|
- front/yarn.lock
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "front_${CI_COMMIT_REF_NAME}"
|
name: "front_${CI_COMMIT_REF_NAME}"
|
||||||
paths:
|
paths:
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
FROM node:6
|
FROM node:9
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
ADD package.json .
|
ADD package.json .
|
||||||
RUN npm install --only=production
|
RUN yarn install --only=production
|
||||||
RUN npm install --only=dev
|
RUN yarn install --only=dev
|
||||||
VOLUME ["/app/node_modules"]
|
VOLUME ["/app/node_modules"]
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue