]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .gitlab-ci.yml
Translated using Weblate (Arabic)
[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:
e5c86ba7 125 - mkdir -p /kaniko/.docker
4ba56322
C
126 - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json
127 script:
c82bf36a 128 - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster --destination $DOCKER_IMAGE_NAME
4ba56322
C
129
130build-docker-develop:
131 <<: *docker
132 only:
133 - schedules
4ba56322 134 variables:
c82bf36a 135 DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-buster
4ba56322
C
136
137build-docker-tag:
138 <<: *docker
139 only:
140 - tags
141 variables:
c82bf36a 142 DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-buster
2e2c02b4
C
143
144build-docker-master:
145 <<: *docker
146 only:
147 - master
148 variables:
c82bf36a 149 DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster
829b794a
C
150
151test-external-plugins:
152 stage: external-plugins
153 only:
154 - schedules
155 services:
156 - name: postgres:9.6
157 alias: postgres
158 - name: redis:latest
159 alias: redis
160 - name: rroemhild/test-openldap
161 alias: ldap
162 variables:
18e09bbb 163 POSTGRES_USER: peertube
ee8e602e 164 POSTGRES_HOST_AUTH_METHOD: trust
829b794a
C
165 REDIS_HOST: redis
166 artifacts:
167 expire_in: 1 day
168 paths:
169 - test*/logs
170 when: always
171 before_script:
172 - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
173 - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
829b794a
C
174 - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
175 script:
943fddfb 176 - PGHOST=postgres PGUSER=peertube npm run ci -- "external-plugins"