2017-06-26 20:04:55 +00:00
|
|
|
variables:
|
|
|
|
IMAGE_NAME: funkwhale/funkwhale
|
2017-06-26 20:24:37 +00:00
|
|
|
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
|
2017-06-26 20:04:55 +00:00
|
|
|
IMAGE_LATEST: $IMAGE_NAME:latest
|
2018-01-09 19:47:03 +00:00
|
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
|
2017-06-26 20:04:55 +00:00
|
|
|
|
|
|
|
|
2017-06-25 17:12:23 +00:00
|
|
|
stages:
|
|
|
|
- test
|
2017-06-25 17:13:46 +00:00
|
|
|
- build
|
2017-06-26 17:48:09 +00:00
|
|
|
- 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
|
2018-01-09 19:47:03 +00:00
|
|
|
image: funkwhale/funkwhale:latest
|
|
|
|
cache:
|
2018-03-20 13:41:36 +00:00
|
|
|
key: "$CI_PROJECT_ID__pip_cache"
|
2018-01-09 19:47:03 +00:00
|
|
|
paths:
|
|
|
|
- "$PIP_CACHE_DIR"
|
2017-12-16 15:10:48 +00:00
|
|
|
variables:
|
2018-02-18 13:28:44 +00:00
|
|
|
DJANGO_ALLOWED_HOSTS: "localhost"
|
2017-12-28 21:59:43 +00:00
|
|
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
2018-02-25 13:43:23 +00:00
|
|
|
FUNKWHALE_URL: "https://funkwhale.ci"
|
2018-03-08 22:20:13 +00:00
|
|
|
CACHEOPS_ENABLED: "false"
|
|
|
|
|
2017-06-25 17:13:46 +00:00
|
|
|
before_script:
|
2017-06-26 15:20:46 +00:00
|
|
|
- cd api
|
2017-12-16 14:19:08 +00:00
|
|
|
- pip install -r requirements/base.txt
|
|
|
|
- pip install -r requirements/local.txt
|
2017-06-26 15:20:46 +00:00
|
|
|
- pip install -r requirements/test.txt
|
2017-06-25 17:13:46 +00:00
|
|
|
script:
|
2017-06-26 17:01:15 +00:00
|
|
|
- pytest
|
2018-01-09 19:47:03 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
|
|
|
|
test_front:
|
|
|
|
stage: test
|
|
|
|
image: node:9
|
|
|
|
before_script:
|
|
|
|
- cd front
|
|
|
|
|
|
|
|
script:
|
|
|
|
- yarn install
|
|
|
|
- yarn run unit
|
2017-12-16 15:10:48 +00:00
|
|
|
cache:
|
2018-03-20 13:41:36 +00:00
|
|
|
key: "$CI_PROJECT_ID__front_dependencies"
|
2017-12-16 15:10:48 +00:00
|
|
|
paths:
|
2018-01-09 19:47:03 +00:00
|
|
|
- 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:
|
2017-06-26 15:20:46 +00:00
|
|
|
- docker
|
2017-06-25 17:13:46 +00:00
|
|
|
|
2018-01-09 19:47:03 +00:00
|
|
|
|
2017-06-25 17:13:46 +00:00
|
|
|
build_front:
|
|
|
|
stage: build
|
2018-01-09 19:47:03 +00:00
|
|
|
image: node:9
|
2017-06-25 17:13:46 +00:00
|
|
|
before_script:
|
|
|
|
- cd front
|
|
|
|
|
|
|
|
script:
|
2018-01-09 19:47:03 +00:00
|
|
|
- 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
|
2018-01-09 19:47:03 +00:00
|
|
|
- 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 14:45:33 +00:00
|
|
|
|
2017-06-23 21:00:42 +00:00
|
|
|
|
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:
|
2017-06-26 15:20:46 +00:00
|
|
|
- develop
|
2017-06-25 17:07:49 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
2017-06-26 17:48:09 +00:00
|
|
|
|
2017-06-26 20:04:55 +00:00
|
|
|
docker_develop:
|
2017-06-26 18:07:19 +00:00
|
|
|
stage: deploy
|
2017-06-26 17:48:09 +00:00
|
|
|
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
|
2017-06-26 17:48:09 +00:00
|
|
|
- cd api
|
|
|
|
script:
|
2017-06-26 20:04:55 +00:00
|
|
|
- docker build -t $IMAGE .
|
|
|
|
- docker push $IMAGE
|
2017-06-26 17:48:09 +00:00
|
|
|
only:
|
|
|
|
- develop
|
2017-06-26 20:04:55 +00:00
|
|
|
tags:
|
|
|
|
- dind
|
|
|
|
|
2017-07-17 20:01:02 +00:00
|
|
|
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!
|
2017-07-17 20:01:02 +00:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
|
|
|
|
|
2017-06-26 20:04:55 +00:00
|
|
|
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
|
2017-06-26 20:04:55 +00:00
|
|
|
- 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
|
2017-06-26 17:48:09 +00:00
|
|
|
tags:
|
|
|
|
- dind
|