]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .gitlab-ci.yml
Add federation compat question in faq
[github/Chocobozzz/PeerTube.git] / .gitlab-ci.yml
CommitLineData
2284f202
C
1image: chocobozzz/peertube-ci:10
2
3stages:
4 - build-and-lint
5 - test
002df381 6 - clients
45de2dfc 7 - docker-nightly
829b794a 8 - external-plugins
2284f202 9
4ba56322
C
10#before_script:
11# - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
12# - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
13# - if [[ $CI_JOB_STAGE == "test" ]]; then psql -c "create user peertube with password 'peertube';"; fi
14# - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
2284f202
C
15
16cache:
17 key: yarn
18 paths:
19 - .yarn-cache
20 - cached-fixtures
21
22###
23## Jobs templates
24#
25#.build-and-lint: &build-and-lint
26# stage: build-and-lint
27#
28#.tests: &tests
29# stage: test
30# dependencies:
31# - build-server
32# services:
33# - name: postgres:9.6
34# alias: postgres
35# - name: redis:latest
36# alias: redis
37# variables:
38# PGHOST: postgres
39# PGUSER: postgres
40# REDIS_HOST: redis
41# artifacts:
42# expire_in: 1 day
43# paths:
44# - test*/logs
45# when: always
46#
47####
48### Build and lint
49##
50#build-server:
51# <<: *build-and-lint
52# artifacts:
53# expire_in: 5h
54# paths:
55# - dist/
56# script:
57# - npm run build:server
58#
59#lint:
60# <<: *build-and-lint
61# script:
62# - yarn install --pure-lockfile --cache-folder .yarn-cache
63# - npm run ci -- "lint"
64#
65####
66### Tests
67#
68#test-misc:
69# <<: *tests
70# script:
71# - yarn install --pure-lockfile --cache-folder .yarn-cache
72# - npm run ci -- "misc"
73#
74#test-cli:
75# <<: *tests
76# retry:
77# max: 1
78# script:
79# - npm run ci -- "cli"
80#
81#api:
82# <<: *tests
83# parallel: 4
84# retry:
85# max: 1
86# script:
87# - NODE_PENDING_JOB_WAIT=1000 npm run ci -- api-$CI_NODE_INDEX
88
002df381
AD
89build-openapi-clients:
90 stage: clients
91 only:
92 refs:
93 - master
94 - schedules
95 changes:
96 - support/doc/api/openapi.yaml
829b794a 97 script:
002df381
AD
98 - apt-get update -qq
99 - apt-get -yqqq install openjdk-8-jre
100 - yarn install --pure-lockfile
101 - scripts/openapi-peertube-version.sh
102 - scripts/openapi-clients.sh
103
2284f202 104build-nightly:
4ba56322 105 stage: docker-nightly
2284f202
C
106 only:
107 - schedules
108 script:
109 - yarn install --pure-lockfile --cache-folder .yarn-cache
110 - npm run nightly
111 - mkdir "${HOME}/.ssh"
112 - chmod 700 "${HOME}/.ssh"
113 - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
114 - eval `ssh-agent -s`
115 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}"); fi
116 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then scp ./peertube-nightly-* ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/nightly; fi
117
4ba56322
C
118.docker: &docker
119 stage: docker-nightly
13927f45 120 cache: {}
4ba56322
C
121 image:
122 name: gcr.io/kaniko-project/executor:debug
123 entrypoint: [""]
124 before_script:
125 - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json
126 script:
c82bf36a 127 - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster --destination $DOCKER_IMAGE_NAME
4ba56322
C
128
129build-docker-develop:
130 <<: *docker
131 only:
132 - schedules
4ba56322 133 variables:
c82bf36a 134 DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-buster
4ba56322
C
135
136build-docker-tag:
137 <<: *docker
138 only:
139 - tags
140 variables:
c82bf36a 141 DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-buster
2e2c02b4
C
142
143build-docker-master:
144 <<: *docker
145 only:
146 - master
147 variables:
c82bf36a 148 DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster
829b794a
C
149
150test-external-plugins:
151 stage: external-plugins
152 only:
153 - schedules
154 services:
155 - name: postgres:9.6
156 alias: postgres
157 - name: redis:latest
158 alias: redis
159 - name: rroemhild/test-openldap
160 alias: ldap
161 variables:
162 PGHOST: postgres
163 PGUSER: postgres
164 REDIS_HOST: redis
165 artifacts:
166 expire_in: 1 day
167 paths:
168 - test*/logs
169 when: always
170 before_script:
171 - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
172 - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
173 - psql -c "create user peertube with password 'peertube';"; fi
174 - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
175 script:
176 - npm run ci -- "external-plugins"