funkwhale/.gitlab-ci.yml

146 wiersze
2.5 KiB
YAML
Czysty Zwykły widok Historia

variables:
IMAGE_NAME: funkwhale/funkwhale
2017-06-26 20:24:37 +00:00
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
IMAGE_LATEST: $IMAGE_NAME:latest
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
2017-06-25 17:12:23 +00:00
stages:
- test
2017-06-25 17:13:46 +00:00
- build
- deploy
2017-06-25 17:13:46 +00:00
test_api:
2017-12-28 21:59:43 +00:00
services:
- postgres:9.4
2017-06-25 17:13:46 +00:00
stage: test
image: funkwhale/funkwhale:latest
cache:
2018-03-20 13:41:36 +00:00
key: "$CI_PROJECT_ID__pip_cache"
paths:
- "$PIP_CACHE_DIR"
variables:
DJANGO_ALLOWED_HOSTS: "localhost"
2017-12-28 21:59:43 +00:00
DATABASE_URL: "postgresql://postgres@postgres/postgres"
FUNKWHALE_URL: "https://funkwhale.ci"
CACHEOPS_ENABLED: "false"
2017-06-25 17:13:46 +00:00
before_script:
- cd api
2017-12-16 14:19:08 +00:00
- pip install -r requirements/base.txt
- pip install -r requirements/local.txt
- pip install -r requirements/test.txt
2017-06-25 17:13:46 +00:00
script:
2018-03-25 20:45:37 +00:00
- pytest --cov=funkwhale_api tests/
tags:
- docker
test_front:
stage: test
image: node:9
before_script:
- cd front
script:
- yarn install
- yarn run unit
cache:
2018-03-20 13:41:36 +00:00
key: "$CI_PROJECT_ID__front_dependencies"
paths:
- front/node_modules
- front/yarn.lock
artifacts:
name: "front_${CI_COMMIT_REF_NAME}"
paths:
- front/dist/
2017-06-25 17:13:46 +00:00
tags:
- docker
2017-06-25 17:13:46 +00:00
2017-06-25 17:13:46 +00:00
build_front:
stage: build
image: node:9
2017-06-25 17:13:46 +00:00
before_script:
- cd front
script:
- yarn install
- yarn run build
2017-06-25 17:13:46 +00:00
cache:
2018-03-20 13:41:36 +00:00
key: "$CI_PROJECT_ID__front_dependencies"
2017-06-25 17:13:46 +00:00
paths:
- front/node_modules
- front/yarn.lock
2017-06-25 17:13:46 +00:00
artifacts:
name: "front_${CI_COMMIT_REF_NAME}"
paths:
- front/dist/
only:
2017-06-26 20:31:52 +00:00
- tags
2017-06-25 17:13:46 +00:00
- master
- develop
tags:
- docker
2017-06-25 17:05:31 +00:00
pages:
2017-06-25 17:12:23 +00:00
stage: test
2018-03-12 22:39:03 +00:00
image: python:3.6-alpine
2017-06-25 17:05:31 +00:00
before_script:
- cd docs
script:
- pip install sphinx
2018-03-12 22:39:03 +00:00
- python -m sphinx . ../public
2017-06-25 17:05:31 +00:00
artifacts:
paths:
- public
only:
- develop
2017-06-25 17:07:49 +00:00
tags:
- docker
docker_develop:
2017-06-26 18:07:19 +00:00
stage: deploy
before_script:
2017-06-26 17:51:25 +00:00
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
2017-06-28 18:11:06 +00:00
- cp -r front/dist api/frontend
- cd api
script:
- docker build -t $IMAGE .
- docker push $IMAGE
only:
- develop
tags:
- dind
build_api:
# Simply publish a zip containing api/ directory
stage: deploy
image: busybox
artifacts:
name: "api_${CI_COMMIT_REF_NAME}"
paths:
- api
2017-07-17 20:01:57 +00:00
script: echo Done!
only:
- tags
- master
- develop
docker_release:
stage: deploy
before_script:
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
2017-06-28 18:11:06 +00:00
- cp -r front/dist api/frontend
- cd api
script:
- docker build -t $IMAGE -t $IMAGE_LATEST .
- docker push $IMAGE
- docker push $IMAGE_LATEST
only:
2017-06-26 20:31:52 +00:00
- tags
tags:
- dind