.gitlab-ci.yml 2.13 KB
Newer Older
Eliot Berriot's avatar
Eliot Berriot committed
1
stages:
Georg Krause's avatar
Georg Krause committed
2
  - lint
Eliot Berriot's avatar
Eliot Berriot committed
3
  - test
Eliot Berriot's avatar
Eliot Berriot committed
4
  - review
Eliot Berriot's avatar
Eliot Berriot committed
5
6
  - build

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

Georg Krause's avatar
Georg Krause committed
10
11
12
13
14
15
16
17
18
19
lint:
  stage: lint
  image: buildkita/puppeteer:10.0.0
  script:
    - yarn lint --max-warnings 0 --no-fix
  cache:
    key: front_node_modules
    paths:
      - "node_modules"

Eliot Berriot's avatar
Eliot Berriot committed
20
21
22
23
24
25
26
27
28
29
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
30
    - pip install "pyld<2" pytest requests requests_mock
Eliot Berriot's avatar
Eliot Berriot committed
31
32
33
  script:
    - pytest test_ns.py

Eliot Berriot's avatar
Eliot Berriot committed
34
35
review:
  stage: review
36
  image: buildkite/puppeteer:10.0.0
Eliot Berriot's avatar
Eliot Berriot committed
37
  interruptible: true
Eliot Berriot's avatar
Eliot Berriot committed
38
39
40
41
  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
42
    - apt-get update && apt-get install -y jq python2
Eliot Berriot's avatar
Eliot Berriot committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    - 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:
Georg Krause's avatar
Georg Krause committed
60
    - main@funkwhale/funkwhale.audio
Eliot Berriot's avatar
Eliot Berriot committed
61
62
63
64
65
66
  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
67
68
69

pages:
  stage: build
70
  image: buildkite/puppeteer:10.0.0
Eliot Berriot's avatar
Eliot Berriot committed
71
72
73
  variables:
    GIT_STRATEGY: clone
  before_script:
74
    - apt-get update && apt-get install -y jq
Eliot Berriot's avatar
Eliot Berriot committed
75
76
77
78
79
80
    - yarn install
  script:
    - yarn lint
    - yarn build
    - rm -rf public
    - mv dist public
Eliot Berriot's avatar
Eliot Berriot committed
81
82
    # 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
83
84
85
    # 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
86
87
    # Gzip compression, cf https://webd97.de/post/gitlab-pages-compression/
    - gzip -k -6 $(find public -type f)
Eliot Berriot's avatar
Eliot Berriot committed
88
89
90
91
92
93
94
95
  cache:
    key: front_node_modules
    paths:
      - "node_modules"
  artifacts:
    paths:
      - public/
  only:
Georg Krause's avatar
Georg Krause committed
96
    - main@funkwhale/funkwhale.audio
Eliot Berriot's avatar
Eliot Berriot committed
97
98
  tags:
    - docker