.gitlab-ci.yml 2.26 KB
Newer Older
1
image: chocobozzz/peertube-ci:15
Chocobozzz's avatar
Chocobozzz committed
2 3

stages:
Average Dude's avatar
Average Dude committed
4
  - clients
5
  - docker-nightly
Chocobozzz's avatar
Chocobozzz committed
6 7 8 9 10 11 12

cache:
  key: yarn
  paths:
    - .yarn-cache
    - cached-fixtures

Average Dude's avatar
Average Dude committed
13 14 15 16 17 18 19 20
build-openapi-clients:
  stage: clients
  only:
    refs:
      - master
      - schedules
    changes:
      - support/doc/api/openapi.yaml
Chocobozzz's avatar
Chocobozzz committed
21
  script:
Average Dude's avatar
Average Dude committed
22 23 24 25 26 27
    - apt-get update -qq
    - apt-get -yqqq install openjdk-8-jre
    - yarn install --pure-lockfile
    - scripts/openapi-peertube-version.sh
    - scripts/openapi-clients.sh

Chocobozzz's avatar
Chocobozzz committed
28
build-nightly:
Chocobozzz's avatar
Chocobozzz committed
29
  stage: docker-nightly
Chocobozzz's avatar
Chocobozzz committed
30 31 32 33 34 35 36 37 38 39 40 41
  only:
    - schedules
  script:
    - yarn install --pure-lockfile --cache-folder .yarn-cache
    - npm run nightly
    - mkdir "${HOME}/.ssh"
    - chmod 700 "${HOME}/.ssh"
    - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
    - eval `ssh-agent -s`
    - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}"); fi
    - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then scp ./peertube-nightly-* ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/nightly; fi

Chocobozzz's avatar
Chocobozzz committed
42 43
.docker: &docker
  stage: docker-nightly
44
  cache: {}
Chocobozzz's avatar
Chocobozzz committed
45 46 47 48
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  before_script:
Chocobozzz's avatar
Chocobozzz committed
49
    - mkdir -p /kaniko/.docker
Chocobozzz's avatar
Chocobozzz committed
50 51
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > /kaniko/.docker/config.json
  script:
52
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $DOCKERFILE --destination $DOCKER_IMAGE_NAME
Chocobozzz's avatar
Chocobozzz committed
53 54 55 56 57 58

build-docker-develop:
  <<: *docker
  only:
    - schedules
  variables:
Chocobozzz's avatar
Chocobozzz committed
59
    DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-buster
60 61 62 63 64 65 66 67 68
    DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster

build-docker-webserver:
  <<: *docker
  only:
    - schedules
  variables:
    DOCKER_IMAGE_NAME: chocobozzz/peertube-webserver
    DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.nginx
Chocobozzz's avatar
Chocobozzz committed
69 70 71 72 73 74

build-docker-tag:
  <<: *docker
  only:
    - tags
  variables:
Chocobozzz's avatar
Chocobozzz committed
75
    DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-buster
76
    DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster
77 78 79 80 81 82

build-docker-master:
  <<: *docker
  only:
    - master
  variables:
Chocobozzz's avatar
Chocobozzz committed
83
    DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster
84
    DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster