diff --git a/jenkins/ApmTikTok b/jenkins/ApmTikTok index ca908bf..5abc61f 100644 --- a/jenkins/ApmTikTok +++ b/jenkins/ApmTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/beteveTikTok b/jenkins/beteveTikTok index 8d4d511..80272e6 100644 --- a/jenkins/beteveTikTok +++ b/jenkins/beteveTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,91 +43,23 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - // ───────────────────────────────────────────── - // 3. Run the bot - // ───────────────────────────────────────────── - stage('Run Script') { - steps { - withCredentials([ - string( - credentialsId: 'TIKTOK_BETEVE_HANDLE', - variable: 'TIKTOK_BETEVE_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_HANDLE', - variable: 'BSKY_BETEVE_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_APP_PASSWORD', - variable: 'BSKY_BETEVE_APP_PASSWORD' - ), - file( - credentialsId: 'TIKTOK_COOKIES_JSON', - variable: 'TIKTOK_COOKIES_FILE' - ) - ]) { - sh ''' - set -e - - # Inject the secret cookies file into the workspace - cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json - - . venv/bin/activate - python3 tiktok2bsky.py \ - --tiktok-handle "$TIKTOK_BETEVE_HANDLE" \ - --bsky-handle "$BSKY_BETEVE_HANDLE" \ - --bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \ - --bsky-base-url https://eurosky.social \ - --bsky-langs ca \ - --cookies-path tiktok_cookies.json - ''' - } - } - } - } - // ───────────────────────────────────────────── // Post actions // ───────────────────────────────────────────── diff --git a/jenkins/btvEsportsTikTok b/jenkins/btvEsportsTikTok index 0477d0f..80272e6 100644 --- a/jenkins/btvEsportsTikTok +++ b/jenkins/btvEsportsTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,91 +43,23 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - // ───────────────────────────────────────────── - // 3. Run the bot - // ───────────────────────────────────────────── - stage('Run Script') { - steps { - withCredentials([ - string( - credentialsId: 'TIKTOK_BTVESPORTS_HANDLE', - variable: 'TIKTOK_BTVESPORTS_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_HANDLE', - variable: 'BSKY_BETEVE_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_APP_PASSWORD', - variable: 'BSKY_BETEVE_APP_PASSWORD' - ), - file( - credentialsId: 'TIKTOK_COOKIES_JSON', - variable: 'TIKTOK_COOKIES_FILE' - ) - ]) { - sh ''' - set -e - - # Inject the secret cookies file into the workspace - cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json - - . venv/bin/activate - python3 tiktok2bsky.py \ - --tiktok-handle "$TIKTOK_BTVESPORTS_HANDLE" \ - --bsky-handle "$BSKY_BETEVE_HANDLE" \ - --bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \ - --bsky-base-url https://eurosky.social \ - --bsky-langs ca \ - --cookies-path tiktok_cookies.json - ''' - } - } - } - } - // ───────────────────────────────────────────── // Post actions // ───────────────────────────────────────────── diff --git a/jenkins/btvNoticiesTikTok b/jenkins/btvNoticiesTikTok index 8bcd02c..5652986 100644 --- a/jenkins/btvNoticiesTikTok +++ b/jenkins/btvNoticiesTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,91 +43,22 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - - // ───────────────────────────────────────────── - // 3. Run the bot - // ───────────────────────────────────────────── - stage('Run Script') { - steps { - withCredentials([ - string( - credentialsId: 'TIKTOK_BTVNOTICIES_HANDLE', - variable: 'TIKTOK_BTVNOTICIES_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_HANDLE', - variable: 'BSKY_BETEVE_HANDLE' - ), - string( - credentialsId: 'BSKY_BETEVE_APP_PASSWORD', - variable: 'BSKY_BETEVE_APP_PASSWORD' - ), - file( - credentialsId: 'TIKTOK_COOKIES_JSON', - variable: 'TIKTOK_COOKIES_FILE' - ) - ]) { - sh ''' - set -e - - # Inject the secret cookies file into the workspace - cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json - - . venv/bin/activate - python3 tiktok2bsky.py \ - --tiktok-handle "$TIKTOK_BTVNOTICIES_HANDLE" \ - --bsky-handle "$BSKY_BETEVE_HANDLE" \ - --bsky-app-password "$BSKY_BETEVE_APP_PASSWORD" \ - --bsky-base-url https://eurosky.social \ - --bsky-langs ca \ - --cookies-path tiktok_cookies.json - ''' - } - } - } - } - // ───────────────────────────────────────────── // Post actions // ───────────────────────────────────────────── diff --git a/jenkins/comedygoldbcnTiktok b/jenkins/comedygoldbcnTiktok index 3933f64..2557a4d 100644 --- a/jenkins/comedygoldbcnTiktok +++ b/jenkins/comedygoldbcnTiktok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,91 +43,23 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - // ───────────────────────────────────────────── - // 3. Run the bot - // ───────────────────────────────────────────── - stage('Run Script') { - steps { - withCredentials([ - string( - credentialsId: 'TIKTOK_COMEDYGOLDBCN_HANDLE', - variable: 'TIKTOK_COMEDYGOLDBCN_HANDLE' - ), - string( - credentialsId: 'BSKY_COMEDYGOLDBCN_HANDLE', - variable: 'BSKY_COMEDYGOLDBCN_HANDLE' - ), - string( - credentialsId: 'BSKY_COMEDYGOLDBCN_APP_PASSWORD', - variable: 'BSKY_COMEDYGOLDBCN_APP_PASSWORD' - ), - file( - credentialsId: 'TIKTOK_COOKIES_JSON', - variable: 'TIKTOK_COOKIES_FILE' - ) - ]) { - sh ''' - set -e - - # Inject the secret cookies file into the workspace - cp "$TIKTOK_COOKIES_FILE" tiktok_cookies.json - - . venv/bin/activate - python3 tiktok2bsky.py \ - --tiktok-handle "$TIKTOK_COMEDYGOLDBCN_HANDLE" \ - --bsky-handle "$BSKY_COMEDYGOLDBCN_HANDLE" \ - --bsky-app-password "$BSKY_COMEDYGOLDBCN_APP_PASSWORD" \ - --bsky-base-url https://bsky.social \ - --bsky-langs ca \ - --cookies-path tiktok_cookies.json - ''' - } - } - } - } - // ───────────────────────────────────────────── // Post actions // ───────────────────────────────────────────── diff --git a/jenkins/crunchyRollTikTok b/jenkins/crunchyRollTikTok index 6c8fa46..46e42eb 100644 --- a/jenkins/crunchyRollTikTok +++ b/jenkins/crunchyRollTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcBarcelonaFemeniTikTok b/jenkins/fcBarcelonaFemeniTikTok index f06c158..402c7d4 100644 --- a/jenkins/fcBarcelonaFemeniTikTok +++ b/jenkins/fcBarcelonaFemeniTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcBarcelonaTikTok b/jenkins/fcBarcelonaTikTok index b41edaa..a5a1aa5 100644 --- a/jenkins/fcBarcelonaTikTok +++ b/jenkins/fcBarcelonaTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/jijantesFCTikTok b/jenkins/jijantesFCTikTok index 88726d2..00a8613 100644 --- a/jenkins/jijantesFCTikTok +++ b/jenkins/jijantesFCTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/laxarxamesTikTok b/jenkins/laxarxamesTikTok index 83ee746..db51b75 100644 --- a/jenkins/laxarxamesTikTok +++ b/jenkins/laxarxamesTikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/rac1TikTok b/jenkins/rac1TikTok index 0131aa0..cdab6cd 100644 --- a/jenkins/rac1TikTok +++ b/jenkins/rac1TikTok @@ -14,32 +14,25 @@ pipeline { stages { - // ───────────────────────────────────────────── - // 1. Checkout - // ───────────────────────────────────────────── stage('Checkout Code') { steps { checkout scm } } - // ───────────────────────────────────────────── - // 2. Python env + dependencies - // ───────────────────────────────────────────── stage('Setup Python & Install Dependencies') { steps { sh ''' set -e + cd "$WORKSPACE" - # ── Create venv ──────────────────────────────────── + # Crea el venv python3 -m venv venv - # ── Upgrade pip toolchain ────────────────────────── - . venv/bin/activate - pip install --upgrade pip wheel setuptools + # Usa sempre python3 -m pip, mai el binari pip directament + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - # ── Core dependencies ────────────────────────────── - pip install -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ playwright \ playwright-stealth \ @@ -50,44 +43,19 @@ pipeline { beautifulsoup4 \ charset-normalizer \ Pillow \ - grapheme + grapheme \ + yt-dlp \ + curl-cffi - # ── yt-dlp: always upgrade to latest ────────────── - # TikTok extractor breaks frequently — latest is required - pip install --upgrade yt-dlp - pip show yt-dlp | grep -E "^(Name|Version)" + # Sanity checks + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + "$WORKSPACE/venv/bin/python3" -c "import yt_dlp; print('yt_dlp OK')" + "$WORKSPACE/venv/bin/python3" -c "import curl_cffi; print('curl_cffi OK')" - # ── curl_cffi: TikTok impersonation (REQUIRED) ───── - # Without this yt-dlp cannot bypass TikTok bot detection - pip install --upgrade curl-cffi - pip show curl-cffi | grep -E "^(Name|Version)" - python3 -c "import curl_cffi; print('curl_cffi OK')" - - # ── playwright-stealth version check ─────────────── - pip show playwright-stealth | grep -E "^(Name|Version)" - python3 -c " -try: - from playwright_stealth import stealth_sync - print('playwright_stealth OK (v1.x - stealth_sync)') -except ImportError: - from playwright_stealth import Stealth - print('playwright_stealth OK (v2.x - Stealth class)') -" - - # ── Sanity checks ────────────────────────────────── - python3 -c "import atproto; print('atproto OK')" - python3 -c "import playwright; print('playwright OK')" - python3 -c "import yt_dlp; print('yt_dlp OK')" - python3 -c "import httpx; print('httpx OK')" - python3 -c "import arrow; print('arrow OK')" - python3 -c "import moviepy; print('moviepy OK')" - - # ── System tools ─────────────────────────────────── - ffmpeg -version | head -1 - ffprobe -version | head -1 - - # ── Playwright browser binaries ──────────────────── - playwright install chromium + # Playwright browser binaries + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } }