Skip to content
Snippets Groups Projects
Forked from funkwhale / funkwhale
5866 commits behind the upstream repository.
.gitlab-ci.yml 7.19 KiB
variables:
  IMAGE_NAME: funkwhale/funkwhale
  IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
  ALL_IN_ONE_IMAGE_NAME: funkwhale/all-in-one
  ALL_IN_ONE_IMAGE: $ALL_IN_ONE_IMAGE_NAME:$CI_COMMIT_REF_NAME
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
  PYTHONDONTWRITEBYTECODE: "true"
  REVIEW_DOMAIN: preview.funkwhale.audio
  REVIEW_INSTANCE_URL: https://demo.funkwhale.audio

stages:
  - 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://dev.funkwhale.audio/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

review_docs:
  stage: review
  image: python:3.6
  when: manual
  allow_failure: true
  variables:
    BUILD_PATH: "../public"