]>
Commit | Line | Data |
---|---|---|
1 | image: chocobozzz/peertube-ci:10 | |
2 | ||
3 | stages: | |
4 | - build-and-lint | |
5 | - test | |
6 | - nightly | |
7 | ||
8 | before_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 | ||
14 | cache: | |
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 | ||
87 | build-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 |