aboutsummaryrefslogtreecommitdiffhomepage
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-29 11:59:29 +0200
committerChocobozzz <me@florianbigard.com>2019-07-29 13:40:39 +0200
commit2284f202070aa2e49156cc52b3b1596a7d5aadec (patch)
tree77aeb00016734667f8ff32a98ea8b4a6ed3ca31e /.gitlab-ci.yml
parent112be80ebdf96ef6a27420c1c6a10097388731a9 (diff)
downloadPeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.tar.gz
PeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.tar.zst
PeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.zip
Add gitlab ci support
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml100
1 files changed, 100 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..2f69eb1d2
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,100 @@
1image: chocobozzz/peertube-ci:10
2
3stages:
4 - build-and-lint
5 - test
6 - nightly
7
8before_script:
9 - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml'
10 - 'sed -i -z "s/redis:\n hostname: ''localhost''/redis:\n hostname: ''redis''/" config/test.yaml'
11 - if [[ $CI_JOB_STAGE == "test" ]]; then psql -c "create user peertube with password 'peertube';"; fi
12 - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
13
14cache:
15 key: yarn
16 paths:
17 - .yarn-cache
18 - cached-fixtures
19
20###
21## Jobs templates
22#
23#.build-and-lint: &build-and-lint
24# stage: build-and-lint
25#
26#.tests: &tests
27# stage: test
28# dependencies:
29# - build-server
30# services:
31# - name: postgres:9.6
32# alias: postgres
33# - name: redis:latest
34# alias: redis
35# variables:
36# PGHOST: postgres
37# PGUSER: postgres
38# REDIS_HOST: redis
39# artifacts:
40# expire_in: 1 day
41# paths:
42# - test*/logs
43# when: always
44#
45####
46### Build and lint
47##
48#build-server:
49# <<: *build-and-lint
50# artifacts:
51# expire_in: 5h
52# paths:
53# - dist/
54# script:
55# - npm run build:server
56#
57#lint:
58# <<: *build-and-lint
59# script:
60# - yarn install --pure-lockfile --cache-folder .yarn-cache
61# - npm run ci -- "lint"
62#
63####
64### Tests
65#
66#test-misc:
67# <<: *tests
68# script:
69# - yarn install --pure-lockfile --cache-folder .yarn-cache
70# - npm run ci -- "misc"
71#
72#test-cli:
73# <<: *tests
74# retry:
75# max: 1
76# script:
77# - npm run ci -- "cli"
78#
79#api:
80# <<: *tests
81# parallel: 4
82# retry:
83# max: 1
84# script:
85# - NODE_PENDING_JOB_WAIT=1000 npm run ci -- api-$CI_NODE_INDEX
86
87build-nightly:
88 stage: nightly
89 only:
90 - schedules
91 script:
92 - yarn install --pure-lockfile --cache-folder .yarn-cache
93 - npm run nightly
94 - mkdir "${HOME}/.ssh"
95 - chmod 700 "${HOME}/.ssh"
96 - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
97 - eval `ssh-agent -s`
98 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}"); fi
99 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then scp ./peertube-nightly-* ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/nightly; fi
100