Commit 06a7c001 authored by Watchtek's avatar Watchtek
Browse files

Update .gitlab-ci.yml file

parent 2fe92500
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+50 −0
Original line number Diff line number Diff line
stages:
  - download

# Reusable template for downloading a package and its dependencies
.default_download_template: &download_template
  variables:
    DEBIAN_FRONTEND: noninteractive
    DEST_DIR: /tmp/tmp
    PACKAGE_NAME: google-chrome-stable   # Default package, can be overridden
  before_script:
    - mkdir -p "$DEST_DIR"
    - apt-get update
    - apt-get install -y wget gnupg apt-rdepends
  script:
    # Optional: add repository if PACKAGE_NAME is Chrome
    - if [ "$PACKAGE_NAME" = "google-chrome-stable" ]; then
        echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list;
        wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -;
      fi

    # Update package lists after adding repo
    - apt-get update

    # Get exact dependencies for PACKAGE_NAME
    - deps=$(apt-rdepends "$PACKAGE_NAME" | grep -v "^ " | grep -v "$PACKAGE_NAME")
    - deps="$PACKAGE_NAME $deps"

    # Download package and dependencies into DEST_DIR
    - cd "$DEST_DIR"
    - for pkg in $deps; do
        apt-get download "$pkg";
      done

    - echo "All .deb files for $PACKAGE_NAME and dependencies are in $DEST_DIR"

  artifacts:
    paths:
      - /tmp/tmp

# Job for Ubuntu 22.04
ubuntu_22_04:
  <<: *download_template
  stage: download
  image: ubuntu:22.04

# Job for Ubuntu 24.04
ubuntu_24_04:
  <<: *download_template
  stage: download
  image: ubuntu:24.04