AgentSkillsCN

deploy-gcp

在修改爬虫脚本后,更新 Cloud Run 作业

SKILL.md
--- frontmatter
name: deploy-gcp
description: Update Cloud Run Jobs after modifying scraper scripts
argument-hint: [job-name|all] [--test]
disable-model-invocation: true
allowed-tools: Bash(gcloud *)

Update Cloud Run Jobs

Rebuild the Docker image and update Cloud Run Job(s) after code modification.

Workflow

Single job: /deploy-gcp [job-name] [--test]

  1. Build and push new image
  2. Update the specified job
  3. (with --test) Execute the job

All jobs: /deploy-gcp all [--test]

  1. Build and push new image (once)
  2. Update ALL 13 jobs
  3. (with --test) Execute all jobs in parallel (async)

All Jobs List (13 total, excluding lifehacker)

Job NameCountrySource
scraper-au-cuponationAUcuponation
scraper-de-mydealzDEmydealz
scraper-de-sparweltDEsparwelt
scraper-es-chollometroESchollometro
scraper-es-cuponationEScuponation
scraper-fr-igraalFRigraal
scraper-fr-mareducFRmareduc
scraper-it-codice-scontoITcodice-sconto
scraper-it-cuponationITcuponation
scraper-uk-hotukdealsUKhotukdeals
scraper-uk-vouchercodesUKvouchercodes
scraper-us-retailmenotUSretailmenot
scraper-us-simplycodesUSsimplycodes

Commands

Build image (once for all)

bash
cd c:\Users\nmusicki\Documents\Python_Scripts\scrap_code\Playwright
gcloud builds submit --tag gcr.io/PROJECT_ID/playwright-scrapers:latest .

Update single job

bash
gcloud run jobs update JOB_NAME \
  --image gcr.io/PROJECT_ID/playwright-scrapers:latest \
  --region europe-west1

Update ALL jobs

bash
for job in scraper-au-cuponation scraper-de-mydealz scraper-de-sparwelt scraper-es-chollometro scraper-es-cuponation scraper-fr-igraal scraper-fr-mareduc scraper-it-codice-sconto scraper-it-cuponation scraper-uk-hotukdeals scraper-uk-vouchercodes scraper-us-retailmenot scraper-us-simplycodes; do
  gcloud run jobs update $job --image gcr.io/PROJECT_ID/playwright-scrapers:latest --region europe-west1
done

Execute ALL jobs (with --test) - runs in parallel

bash
for job in scraper-au-cuponation scraper-de-mydealz scraper-de-sparwelt scraper-es-chollometro scraper-es-cuponation scraper-fr-igraal scraper-fr-mareduc scraper-it-codice-sconto scraper-it-cuponation scraper-uk-hotukdeals scraper-uk-vouchercodes scraper-us-retailmenot scraper-us-simplycodes; do
  echo "🚀 Launching $job..."
  gcloud run jobs execute $job --region europe-west1 --async
done

Examples

  • /deploy-gcp scraper-uk-hotukdeals - Update 1 job
  • /deploy-gcp scraper-uk-hotukdeals --test - Update + run 1 job
  • /deploy-gcp all - Update les 13 jobs
  • /deploy-gcp all --test - Update + run les 13 jobs

Notes

  • all exclut lifehacker (non utilisé)
  • Une seule image Docker pour tous les jobs
  • --test lance tous les jobs en parallèle (async) - suivre la progression dans la console GCP