Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • Julian's avatar
    Julian committed
    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/bullseye
    
    Julian's avatar
    Julian committed
      script:
    
      - git clone --depth 1 --branch ${UPSTREAM_VERSION} https://github.com/RocketChat/Rocket.Chat rocketchat
    
      - NODEJS_VERSION="$(jq -r .engines.node rocketchat/package.json)"
      - METEOR_VERSION="$(cut -d@ -f2 rocketchat/apps/meteor/.meteor/release)"
      - wget -q "https://deb.nodesource.com/node_14.x/pool/main/n/nodejs/nodejs_${NODEJS_VERSION}-deb-1nodesource1_amd64.deb" -O nodejs.deb
      - apt-get -qq install ./nodejs.deb
      # NodeJS < 14.9.0 did not contain corepack
      - test -e /usr/bin/corepack || npm install -g corepack
      # Install/enable yarn
      - corepack enable
      - rm nodejs.deb
    
    Julian's avatar
    Julian committed
      - wget -q "https://static.meteor.com/packages-bootstrap/${METEOR_VERSION}/meteor-bootstrap-os.linux.x86_64.tar.gz" -O meteor-bootstrap.tar.gz
    
      # The package only contains an ".meteor" directory that ends up in "/root/.meteor"
      - tar -C ~/ -xzf meteor-bootstrap.tar.gz
      - rm meteor-bootstrap.tar.gz
      - export METEOR_ALLOW_SUPERUSER=true
      - export PATH=$PATH:/root/.meteor
      - meteor --version
    
    Julian's avatar
    Julian committed
      - cd rocketchat && YARN_CHECKSUM_BEHAVIOR=update yarn install --json && git diff yarn.lock && cd ..
    
    Julian's avatar
    Julian committed
      # yarn build:ci uses hard-coded /tmp/dist directory for build output
      - cd rocketchat && yarn build:ci && cd .. && mv /tmp/dist ./build
    
    Julian's avatar
    Julian committed
      - cd build/bundle/programs/server/ && npm install --production && cd ../../../..
    
    Julian's avatar
    Julian committed
      artifacts:
        paths:
        - build
    
    build:binary:bullseye:
      extends: .build:binary
    
    package:apt:bullseye:
      extends: .package:apt
      dependencies:
      - build:binary:bullseye
      needs:
      - build:binary:bullseye
    
    
    # for now, publish the bullseye package for buster as well
    publish:apt:buster:
      extends: .publish:apt
      variables:
        APTLY_DISTRO: buster
      dependencies:
      - package:apt:bullseye
      needs:
      - package:apt:bullseye
    
    
    Julian's avatar
    Julian committed
    publish:apt:bullseye:
      extends: .publish:apt
      variables:
        APTLY_DISTRO: bullseye
      dependencies:
      - package:apt:bullseye
      needs:
      - package:apt:bullseye