Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c369161 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Download ruleset_converter from latest tag pipeline

parent 3bfb9a3c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,3 +9,4 @@ depot_tools/
.gcs_entries
*.txt
*.dat
ruleset_converter
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ update-filters:
  extends: .build-filters
  needs: []
  script: 
    - apt-get update && apt-get install -y curl
    - apt-get update && apt-get install -y curl jq
    - bash generate_filters.sh
  artifacts:
    paths:
+41 −0
Original line number Diff line number Diff line
#!/bin/bash

set -e

GITLAB_API="https://gitlab.e.foundation/api/v4"
PROJECT_PATH=$(echo -n "e/os/browser" | jq -sRr @uri)

for tag in $(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/repository/tags" | jq -r '.[].name'); do
    echo "Checking tag: $tag"

    pipeline_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines?ref=${tag}&status=success" \
        | jq -r '.[0].id')

    if [ "$pipeline_id" != "null" ] && [ -n "$pipeline_id" ]; then
        echo "Found successful pipeline for tag $tag (Pipeline ID: $pipeline_id)"
        selected_tag=$tag
        break
    fi
done

if [ -z "$selected_tag" ]; then
    echo "No tag with successful pipeline found"
    exit 1
fi

echo "Looking for build-cromite-x64 job in pipeline $pipeline_id..."

job_id=$(curl -s "${GITLAB_API}/projects/${PROJECT_PATH}/pipelines/${pipeline_id}/jobs" \
    | jq -r '.[] | select(.name=="build-cromite-x64") | .id')

if [ -z "$job_id" ]; then
    echo "No job named build-cromite-x64 found in pipeline $pipeline_id"
    exit 1
fi

echo "Downloading ruleset_converter from job $job_id..."
curl -L \
    --output ruleset_converter \
    "${GITLAB_API}/projects/${PROJECT_PATH}/jobs/${job_id}/artifacts/bin/ruleset_converter"

chmod +x ruleset_converter

echo "Downloading filter lists..."
curl -o easylist.txt https://easylist.to/easylist/easylist.txt
curl -o easyprivacy.txt https://easylist.to/easylist/easyprivacy.txt

ruleset_converter

deleted100755 → 0
−2.92 MiB

File deleted.