diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67d00bee6cb7b9010a4177b87a5f5b66b8ef42eb..352574e709a1d6a7f264c4d336944b7b67623469 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,32 @@ docker: changes: - Dockerfile-base +test_ppparis: + stage: test + image: registry.git.laquadrature.net/bastien/raaspotter/base:latest + tags: + - unprivileged + needs: [install] + script: + - curl --silent --location --output artifacts.zip "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${CI_JOB_NAME}&job_token=${CI_JOB_TOKEN}" || true + - unzip -q artifacts.zip data/ppparis/* || true + - rm artifacts.zip || true + - source bin/activate + - python ./cli.py --pref ppparis + retry: 2 + only: + - main + cache: + key: $CI_COMMIT_REF_SLUG + paths: + - bin/ + - lib/ + - pyvenv.cfg + artifacts: + paths: + - data/ppparis/*.txt + - output.log + expire_in: 1 hour install: stage: install @@ -212,30 +238,3 @@ test_pref62: - data/pref62/*.txt - output.log expire_in: 1 hour - -test_ppparis: - stage: test - image: registry.git.laquadrature.net/bastien/raaspotter/base:latest - tags: - - unprivileged - needs: [install] - script: - - curl --silent --location --output artifacts.zip "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/${CI_COMMIT_BRANCH}/download?job=${CI_JOB_NAME}&job_token=${CI_JOB_TOKEN}" || true - - unzip -q artifacts.zip data/ppparis/* || true - - rm artifacts.zip || true - - source bin/activate - - python ./cli.py --pref ppparis - retry: 2 - only: - - main - cache: - key: $CI_COMMIT_REF_SLUG - paths: - - bin/ - - lib/ - - pyvenv.cfg - artifacts: - paths: - - data/ppparis/*.txt - - output.log - expire_in: 1 hour diff --git a/Makefile b/Makefile index 1e339f19fb6422d7439a0ed80eace105b913671d..5d1cd9731ade7f39791256bd62b667b0e346c970 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -make: pref06 pref13 pref35 pref38 pref59 pref62 ppparis +make: ppparis pref06 pref13 pref35 pref38 pref59 pref62 +ppparis: + python cli.py --pref ppparis pref06: python cli.py --pref pref06 pref13: @@ -11,5 +13,3 @@ pref59: python cli.py --pref pref59 pref62: python cli.py --pref pref62 -ppparis: - python cli.py --pref ppparis diff --git a/README.md b/README.md index 93c8aa3fb0ded09f943460aff544c20a1b2655ea..9b79bfa16ca9def755b43ce025117ff6471d2689 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,12 @@ Il est possible de ne lancer l'analyse que pour une seule administration, avec l ## Administrations supportées +- Préfecture de police de Paris (identifiant : `ppparis`) - Préfecture des Alpes-Maritimes (identifiant : `pref06`) - Préfecture des Bouches-du-Rhône (identifiant : `pref13`) - Préfecture d'Ille-et-Vilaine (identifiant : `pref35`) - Préfecture du Nord (identifiant : `pref59`) - Préfecture du Pas-de-Calais (identifiant : `pref62`) -- Préfecture de police de Paris (identifiant : `ppparis`) ## Licence diff --git a/cli.py b/cli.py index 4efb8619b999ec65fbb24ea9f43d6dd2e120550d..33f05d95e1e5ebeabd64a5804995c2ca3c50a0e4 100755 --- a/cli.py +++ b/cli.py @@ -35,13 +35,13 @@ __MASTODON_INSTANCE = os.getenv('MASTODON_INSTANCE') # Liste des préfectures supportées available_prefs = [ + 'ppparis', 'pref06', 'pref13', 'pref35', 'pref38', 'pref59', - 'pref62', - 'ppparis' + 'pref62' ] # Début du script