Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.95 KiB
Newer Older
Eliot Berriot's avatar
Eliot Berriot committed
stages:
Eliot Berriot's avatar
Eliot Berriot committed
  - test
Eliot Berriot's avatar
Eliot Berriot committed
  - review
Eliot Berriot's avatar
Eliot Berriot committed
  - build

Eliot Berriot's avatar
Eliot Berriot committed
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"

test_jsonld_ns:
  stage: test
  image: python:3
  interruptible: true
  cache:
    key: "$CI_PROJECT_ID__pip_cache"
    paths:
      - "$PIP_CACHE_DIR"

  before_script:
Agate's avatar
Agate committed
    - pip install "pyld<2" pytest requests requests_mock
Eliot Berriot's avatar
Eliot Berriot committed
  script:
    - pytest test_ns.py

Eliot Berriot's avatar
Eliot Berriot committed
review:
  stage: review
Agate's avatar
Agate committed
  image: buildkite/puppeteer:5.2.1
Eliot Berriot's avatar
Eliot Berriot committed
  interruptible: true
Eliot Berriot's avatar
Eliot Berriot committed
  variables:
    GIT_STRATEGY: clone
    VUE_APP_ROUTER_BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/review/
  before_script:
Agate's avatar
Agate committed
    - apt-get update && apt-get install -y jq python2
Eliot Berriot's avatar
Eliot Berriot committed
    - yarn install
  script:
    - yarn lint
    - yarn build
    - rm -rf review
    - mv dist review
  cache:
    key: front_node_modules
    paths:
      - "node_modules"
  artifacts:
    expire_in: 2 weeks
    paths:
      - review
  only:
    - branches
  except:
    - master@funkwhale/funkwhale.audio
  tags:
    - docker
  environment:
    name: review/front/$CI_COMMIT_REF_NAME
    url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/review/index.html

Eliot Berriot's avatar
Eliot Berriot committed

pages:
  stage: build
Agate's avatar
Agate committed
  image: buildkite/puppeteer:5.2.1
Eliot Berriot's avatar
Eliot Berriot committed
  variables:
    GIT_STRATEGY: clone
  before_script:
    - apt-get update && apt-get install -y jq
Eliot Berriot's avatar
Eliot Berriot committed
    - yarn install
  script:
    - yarn lint
    - yarn build
    - rm -rf public
    - mv dist public
Eliot Berriot's avatar
Eliot Berriot committed
    # copy markdown pages so these can be reused by other sites, if needed
    - cp -r src/pages public/pages
Eliot Berriot's avatar
Eliot Berriot committed
    # ugly hack from https://gitlab.com/gitlab-org/gitlab-pages/issues/23#note_57499396
    # until Gitlab Pages has better support for SPA
    - cp public/index.html public/404.html
Eliot Berriot's avatar
Eliot Berriot committed
    # Gzip compression, cf https://webd97.de/post/gitlab-pages-compression/
    - gzip -k -6 $(find public -type f)
Eliot Berriot's avatar
Eliot Berriot committed
  cache:
    key: front_node_modules
    paths:
      - "node_modules"
  artifacts:
    paths:
      - public/
  only:
    - master@funkwhale/funkwhale.audio
  tags:
    - docker