include:
  - project: 'infra/packages/ci-utils'
    ref: main
    file: 'shared-ci.yml'
  - local: 'gitlabci-version.yml'
#  - project: 'infra/packages/ci-utils'
#    ref: main
#    file: 'debian-binary.yml'

variables:
  PACKAGE_NAME: rocketchat
  UPSTREAM_GITHUB_PATH: RocketChat/Rocket.Chat

autoupdate:
  extends: .autoupdate:github:release-tags

.build:binary:
  extends: .build
  image: registry.git.cccv.de/infra/packages/docker-images/meteor
  script:
  - meteor --version
  - git clone --depth 1 --branch ${UPSTREAM_VERSION} https://github.com/RocketChat/Rocket.Chat rocketchat
  - cd rocketchat && npm install && cd ..
  - cd rocketchat && meteor build --directory ../build && cd ..
  - cd build/bundle/programs/server/ && npm install && cd ../../../..
  artifacts:
    paths:
    - build

build:binary:bullseye:
  extends: .build:binary

package:apt:bullseye:
  extends: .package:apt
  dependencies:
  - build:binary:bullseye
  needs:
  - build:binary:bullseye

publish:apt:bullseye:
  extends: .publish:apt
  variables:
    APTLY_DISTRO: bullseye
  dependencies:
  - package:apt:bullseye
  needs:
  - package:apt:bullseye