aboutsummaryrefslogtreecommitdiffhomepage
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 09:44:34 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 14:17:32 +0200
commit4ba5632266d0cdd54e8e09ac7416c2aa415eed65 (patch)
tree03e69e1c0eac24848f57368bb6f224cd62240500 /.gitlab-ci.yml
parent0c503f5c87ec0fbd764ece910a5b11809303cb79 (diff)
downloadPeerTube-4ba5632266d0cdd54e8e09ac7416c2aa415eed65.tar.gz
PeerTube-4ba5632266d0cdd54e8e09ac7416c2aa415eed65.tar.zst
PeerTube-4ba5632266d0cdd54e8e09ac7416c2aa415eed65.zip
Build docker image on gitlab
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml38
1 files changed, 31 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2f69eb1d2..401a5c960 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,13 +3,13 @@ image: chocobozzz/peertube-ci:10
3stages: 3stages:
4 - build-and-lint 4 - build-and-lint
5 - test 5 - test
6 - nightly 6 - docker-nightly
7 7
8before_script: 8#before_script:
9 - 'sed -i -z "s/database:\n hostname: ''localhost''/database:\n hostname: ''postgres''/" config/test.yaml' 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' 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 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 12# - NOCLIENT=1 yarn install --pure-lockfile --cache-folder .yarn-cache
13 13
14cache: 14cache:
15 key: yarn 15 key: yarn
@@ -85,7 +85,7 @@ cache:
85# - NODE_PENDING_JOB_WAIT=1000 npm run ci -- api-$CI_NODE_INDEX 85# - NODE_PENDING_JOB_WAIT=1000 npm run ci -- api-$CI_NODE_INDEX
86 86
87build-nightly: 87build-nightly:
88 stage: nightly 88 stage: docker-nightly
89 only: 89 only:
90 - schedules 90 - schedules
91 script: 91 script:
@@ -98,3 +98,27 @@ build-nightly:
98 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}"); fi 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 99 - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then scp ./peertube-nightly-* ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/nightly; fi
100 100
101.docker: &docker
102 stage: docker-nightly
103 image:
104 name: gcr.io/kaniko-project/executor:debug
105 entrypoint: [""]
106 before_script:
107 - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json
108 script:
109 - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/support/docker/production/Dockerfile.stretch --destination $DOCKER_IMAGE_NAME
110
111build-docker-develop:
112 <<: *docker
113 only:
114 - schedules
115 - develop
116 variables:
117 DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-stretch
118
119build-docker-tag:
120 <<: *docker
121 only:
122 - tags
123 variables:
124 DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-stretch