Commit 336e98f6 authored by Watchtek's avatar Watchtek
Browse files

Update .gitlab-ci.yml file

parent 265d2af0
Loading
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ stages:

.default_download_template: &download_template
  stage: download
  image: ubuntu:22.04  # default image, overridden below
  image: ubuntu:22.04
  variables:
    DEBIAN_FRONTEND: noninteractive
    DEST_DIR: /tmp/tmp
@@ -16,19 +16,16 @@ stages:
    - |
      set -e

      # Add Google Chrome repository if PACKAGE_NAME is Chrome
      # Add Chrome repository
      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 quietly
      apt-get update -qq

      echo "📦 Resolving dependencies for $PACKAGE_NAME..."

      # Get dependencies, filter out virtual packages
      deps=$(apt-rdepends "$PACKAGE_NAME" \
        | grep -v "^ " \
        | grep -v "$PACKAGE_NAME" \
@@ -40,35 +37,35 @@ stages:

      cd "$DEST_DIR"

      # Download real packages only
      for pkg in $deps; do
        if ls "$pkg"_*.deb >/dev/null 2>&1; then
          echo "Already downloaded: $pkg"
        elif apt-cache show "$pkg" >/dev/null 2>&1; then
          echo "Downloading: $pkg"
          apt-get download -qq "$pkg"
        else
          continue
        fi

        if ! apt-cache show "$pkg" >/dev/null 2>&1; then
          echo "Skipping virtual or missing package: $pkg"
          continue
        fi

        echo "Downloading: $pkg"
        apt-get download -qq "$pkg" || echo "⚠️ Failed to download $pkg (maybe virtual)"
      done

      chmod -R a+r "$DEST_DIR"
      echo "✅ All .deb files for $PACKAGE_NAME and dependencies are in $DEST_DIR"

  artifacts:
    paths:
      - /tmp/tmp

  cache:
    key: apt-cache
    paths:
      - /var/cache/apt/archives

# Ubuntu 22.04 job
ubuntu_22_04:
  <<: *download_template
  image: ubuntu:22.04

# Ubuntu 24.04 job
ubuntu_24_04:
  <<: *download_template
  image: ubuntu:24.04