Verified Commit 541f4082 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

WIP

parent 8d75d58e
Pipeline #2167 failed with stage
in 1 second
......@@ -8,231 +8,231 @@ variables:
REVIEW_INSTANCE_URL: https://demo.funkwhale.audio
stages:
- review
- lint
- test
- build
# - review
# - lint
# - test
# - build
- deploy
review_front:
stage: review
image: node:9
when: manual
allow_failure: true
before_script:
- curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
- chmod +x /usr/local/bin/jq
- cd front
script:
- yarn install
- yarn run i18n-compile
# this is to ensure we don't have any errors in the output,
# cf https://code.eliotberriot.com/funkwhale/funkwhale/issues/169
- VUE_APP_INSTANCE_URL=$REVIEW_INSTANCE_URL yarn run build | tee /dev/stderr | (! grep -i 'ERROR in')
- mkdir -p /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
- cp -r dist/* /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
cache:
key: "funkwhale__front_dependencies"
paths:
- front/node_modules
- front/yarn.lock
environment:
name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
url: http://front-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
on_stop: stop_front_review
only:
- branches
tags:
- funkwhale-review
# review_front:
# stage: review
# image: node:9
# when: manual
# allow_failure: true
# before_script:
# - curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
# - chmod +x /usr/local/bin/jq
# - cd front
# script:
# - yarn install
# - yarn run i18n-compile
# # this is to ensure we don't have any errors in the output,
# # cf https://code.eliotberriot.com/funkwhale/funkwhale/issues/169
# - VUE_APP_INSTANCE_URL=$REVIEW_INSTANCE_URL yarn run build | tee /dev/stderr | (! grep -i 'ERROR in')
# - mkdir -p /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# - cp -r dist/* /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# cache:
# key: "funkwhale__front_dependencies"
# paths:
# - front/node_modules
# - front/yarn.lock
# environment:
# name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# url: http://front-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
# on_stop: stop_front_review
# only:
# - branches
# tags:
# - funkwhale-review
stop_front_review:
stage: review
script:
- rm -rf /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
variables:
GIT_STRATEGY: none
when: manual
only:
- branches
environment:
name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
action: stop
tags:
- funkwhale-review
# stop_front_review:
# stage: review
# script:
# - rm -rf /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
# variables:
# GIT_STRATEGY: none
# when: manual
# only:
# - branches
# environment:
# name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# action: stop
# tags:
# - funkwhale-review
review_docs:
stage: review
image: python:3.6
when: manual
allow_failure: true
variables:
BUILD_PATH: "../public"
before_script:
- cd docs
- apt-get update
- apt-get install -y graphviz
- pip install sphinx
# review_docs:
# stage: review
# image: python:3.6
# when: manual
# allow_failure: true
# variables:
# BUILD_PATH: "../public"
# before_script:
# - cd docs
# - apt-get update
# - apt-get install -y graphviz
# - pip install sphinx
cache:
key: "$CI_PROJECT_ID__sphinx"
paths:
- "$PIP_CACHE_DIR"
script:
- ./build_docs.sh
- mkdir -p /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
- cp -r $CI_PROJECT_DIR/public/* /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
environment:
name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
url: http://docs-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
on_stop: stop_docs_review
only:
- branches
tags:
- funkwhale-review
# cache:
# key: "$CI_PROJECT_ID__sphinx"
# paths:
# - "$PIP_CACHE_DIR"
# script:
# - ./build_docs.sh
# - mkdir -p /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# - cp -r $CI_PROJECT_DIR/public/* /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# environment:
# name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# url: http://docs-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
# on_stop: stop_docs_review
# only:
# - branches
# tags:
# - funkwhale-review
stop_docs_review:
stage: review
script:
- rm -rf /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
variables:
GIT_STRATEGY: none
when: manual
only:
- branches
environment:
name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
action: stop
tags:
- funkwhale-review
# stop_docs_review:
# stage: review
# script:
# - rm -rf /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
# variables:
# GIT_STRATEGY: none
# when: manual
# only:
# - branches
# environment:
# name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
# action: stop
# tags:
# - funkwhale-review
black:
image: python:3.6
stage: lint
variables:
GIT_STRATEGY: fetch
before_script:
- pip install black
script:
- black --exclude "/(\.git|\.hg|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|migrations)/" --check --diff api/
# black:
# image: python:3.6
# stage: lint
# variables:
# GIT_STRATEGY: fetch
# before_script:
# - pip install black
# script:
# - black --exclude "/(\.git|\.hg|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|migrations)/" --check --diff api/
flake8:
image: python:3.6
stage: lint
variables:
GIT_STRATEGY: fetch
before_script:
- pip install flake8
script:
- flake8 -v api
cache:
key: "$CI_PROJECT_ID__flake8_pip_cache"
paths:
- "$PIP_CACHE_DIR"
# flake8:
# image: python:3.6
# stage: lint
# variables:
# GIT_STRATEGY: fetch
# before_script:
# - pip install flake8
# script:
# - flake8 -v api
# cache:
# key: "$CI_PROJECT_ID__flake8_pip_cache"
# paths:
# - "$PIP_CACHE_DIR"
test_api:
services:
- postgres:9.4
- redis:3
stage: test
image: funkwhale/funkwhale:latest
cache:
key: "$CI_PROJECT_ID__pip_cache"
paths:
- "$PIP_CACHE_DIR"
variables:
DJANGO_ALLOWED_HOSTS: "localhost"
DATABASE_URL: "postgresql://postgres@postgres/postgres"
FUNKWHALE_URL: "https://funkwhale.ci"
DJANGO_SETTINGS_MODULE: config.settings.local
only:
- branches
before_script:
- cd api
- apt-get update
- grep "^[^#;]" requirements.apt | grep -Fv "python3-dev" | xargs apt-get install -y --no-install-recommends
- pip install -r requirements/base.txt
- pip install -r requirements/local.txt
- pip install -r requirements/test.txt
script:
- pytest --cov=funkwhale_api tests/
tags:
- docker
# test_api:
# services:
# - postgres:9.4
# - redis:3
# stage: test
# image: funkwhale/funkwhale:latest
# cache:
# key: "$CI_PROJECT_ID__pip_cache"
# paths:
# - "$PIP_CACHE_DIR"
# variables:
# DJANGO_ALLOWED_HOSTS: "localhost"
# DATABASE_URL: "postgresql://postgres@postgres/postgres"
# FUNKWHALE_URL: "https://funkwhale.ci"
# DJANGO_SETTINGS_MODULE: config.settings.local
# only:
# - branches
# before_script:
# - cd api
# - apt-get update
# - grep "^[^#;]" requirements.apt | grep -Fv "python3-dev" | xargs apt-get install -y --no-install-recommends
# - pip install -r requirements/base.txt
# - pip install -r requirements/local.txt
# - pip install -r requirements/test.txt
# script:
# - pytest --cov=funkwhale_api tests/
# tags:
# - docker
test_front:
stage: test
image: node:9
before_script:
- cd front
only:
- branches
script:
- yarn install
- yarn test:unit
cache:
key: "funkwhale__front_dependencies"
paths:
- front/node_modules
- front/yarn.lock
artifacts:
name: "front_${CI_COMMIT_REF_NAME}"
paths:
- front/dist/
tags:
- docker
# test_front:
# stage: test
# image: node:9
# before_script:
# - cd front
# only:
# - branches
# script:
# - yarn install
# - yarn test:unit
# cache:
# key: "funkwhale__front_dependencies"
# paths:
# - 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:
- curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
- chmod +x /usr/local/bin/jq
- cd front
script:
- yarn install
- yarn run i18n-compile
# this is to ensure we don't have any errors in the output,
# cf https://code.eliotberriot.com/funkwhale/funkwhale/issues/169
- yarn build | tee /dev/stderr | (! grep -i 'ERROR in')
- chmod -R 755 dist
cache:
key: "funkwhale__front_dependencies"
paths:
- front/node_modules
- front/yarn.lock
artifacts:
name: "front_${CI_COMMIT_REF_NAME}"
paths:
- front/dist/
only:
- tags@funkwhale/funkwhale
- master@funkwhale/funkwhale
- develop@funkwhale/funkwhale
tags:
- docker
# build_front:
# stage: build
# image: node:9
# before_script:
# - curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
# - chmod +x /usr/local/bin/jq
# - cd front
# script:
# - yarn install
# - yarn run i18n-compile
# # this is to ensure we don't have any errors in the output,
# # cf https://code.eliotberriot.com/funkwhale/funkwhale/issues/169
# - yarn build | tee /dev/stderr | (! grep -i 'ERROR in')
# - chmod -R 755 dist
# cache:
# key: "funkwhale__front_dependencies"
# paths:
# - front/node_modules
# - front/yarn.lock
# artifacts:
# name: "front_${CI_COMMIT_REF_NAME}"
# paths:
# - front/dist/
# only:
# - tags@funkwhale/funkwhale
# - master@funkwhale/funkwhale
# - develop@funkwhale/funkwhale
# tags:
# - docker
pages:
stage: test
image: python:3.6
variables:
BUILD_PATH: "../public"
before_script:
- cd docs
- apt-get update
- apt-get install -y graphviz
- pip install sphinx
script:
- ./build_docs.sh
cache:
key: "$CI_PROJECT_ID__sphinx"
paths:
- "$PIP_CACHE_DIR"
artifacts:
paths:
- public
only:
- develop@funkwhale/funkwhale
tags:
- docker
# pages:
# stage: test
# image: python:3.6
# variables:
# BUILD_PATH: "../public"
# before_script:
# - cd docs
# - apt-get update
# - apt-get install -y graphviz
# - pip install sphinx
# script:
# - ./build_docs.sh
# cache:
# key: "$CI_PROJECT_ID__sphinx"
# paths:
# - "$PIP_CACHE_DIR"
# artifacts:
# paths:
# - public
# only:
# - develop@funkwhale/funkwhale
# tags:
# - docker
docker_release:
stage: deploy
......@@ -242,10 +242,10 @@ docker_release:
- cd api
script:
- docker build -t $IMAGE .
- docker push $IMAGE
only:
- develop@funkwhale/funkwhale
- tags@funkwhale/funkwhale
# - docker push $IMAGE
# only:
# - develop@funkwhale/funkwhale
# - tags@funkwhale/funkwhale
tags:
- docker-build
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment