From 7077ad4adb804e200a03037068f10208df96fb40 Mon Sep 17 00:00:00 2001 From: Guillem Hernandez Sola Date: Tue, 30 Jun 2026 16:15:29 +0200 Subject: [PATCH] tw --- jenkins/FCBFutbolSalaTw | 53 ++++++++++++++++++++++------------- jenkins/FCBHandbolTw | 53 ++++++++++++++++++++++------------- jenkins/FCBHoqueiTw | 53 ++++++++++++++++++++++------------- jenkins/apmTw | 53 ++++++++++++++++++++++------------- jenkins/beteveTw | 54 ++++++++++++++++++++++------------- jenkins/bomberscatTw | 53 ++++++++++++++++++++++------------- jenkins/btvEsportsTw | 54 ++++++++++++++++++++++------------- jenkins/btvLlenguaTw | 54 ++++++++++++++++++++++------------- jenkins/btvNoticiesTw | 54 ++++++++++++++++++++++------------- jenkins/comedygoldbcnTw | 54 ++++++++++++++++++++++------------- jenkins/crunchyTw | 53 ++++++++++++++++++++++------------- jenkins/elRacoDelMangaTw | 53 ++++++++++++++++++++++------------- jenkins/elmonaRAC1Tw | 54 ++++++++++++++++++++++------------- jenkins/emergenciescatTw | 53 ++++++++++++++++++++++------------- jenkins/esport3Tw | 55 ++++++++++++++++++++++-------------- jenkins/esportsRAC1Tw | 54 ++++++++++++++++++++++------------- jenkins/esportsenxarxaTw | 54 ++++++++++++++++++++++------------- jenkins/fcbarcelonaCatTw | 55 ++++++++++++++++++++++-------------- jenkins/fcbarcelonaTw | 55 ++++++++++++++++++++++-------------- jenkins/fcbatleticTw | 53 ++++++++++++++++++++++------------- jenkins/fcbbasketTw | 53 ++++++++++++++++++++++------------- jenkins/fcbfemeniTw | 53 ++++++++++++++++++++++------------- jenkins/jijantesFC | 46 +++++++++++++++--------------- jenkins/laCompetenciaRAC1Tw | 54 ++++++++++++++++++++++------------- jenkins/laxarxamesTw | 54 ++++++++++++++++++++++------------- jenkins/meteoRAC1Tw | 54 ++++++++++++++++++++++------------- jenkins/meteocatTw | 55 ++++++++++++++++++++++-------------- jenkins/mossosTw | 53 ++++++++++++++++++++++------------- jenkins/nohoseRAC1Tw | 54 ++++++++++++++++++++++------------- jenkins/optimotTw | 54 ++++++++++++++++++++++------------- jenkins/polonia3CatTw | 54 ++++++++++++++++++++++------------- jenkins/semgencatTw | 55 ++++++++++++++++++++++-------------- jenkins/transitTw | 53 ++++++++++++++++++++++------------- jenkins/versioRac1MergedTw | 54 ++++++++++++++++++++++------------- jenkins/vialliureRAC1Tw | 56 +++++++++++++++++++++++-------------- 35 files changed, 1168 insertions(+), 708 deletions(-) diff --git a/jenkins/FCBFutbolSalaTw b/jenkins/FCBFutbolSalaTw index cd51c56..bcd5064 100644 --- a/jenkins/FCBFutbolSalaTw +++ b/jenkins/FCBFutbolSalaTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/FCBHandbolTw b/jenkins/FCBHandbolTw index a1fc669..efd9d5b 100644 --- a/jenkins/FCBHandbolTw +++ b/jenkins/FCBHandbolTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/FCBHoqueiTw b/jenkins/FCBHoqueiTw index 3f0aca8..423c034 100644 --- a/jenkins/FCBHoqueiTw +++ b/jenkins/FCBHoqueiTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/apmTw b/jenkins/apmTw index 0382c80..d7c900e 100644 --- a/jenkins/apmTw +++ b/jenkins/apmTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,26 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/beteveTw b/jenkins/beteveTw index f0509ac..de96b29 100644 --- a/jenkins/beteveTw +++ b/jenkins/beteveTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/bomberscatTw b/jenkins/bomberscatTw index 229f1a6..eae8136 100644 --- a/jenkins/bomberscatTw +++ b/jenkins/bomberscatTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/btvEsportsTw b/jenkins/btvEsportsTw index 8491bcd..81e0e30 100644 --- a/jenkins/btvEsportsTw +++ b/jenkins/btvEsportsTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/btvLlenguaTw b/jenkins/btvLlenguaTw index b0407fe..f39e720 100644 --- a/jenkins/btvLlenguaTw +++ b/jenkins/btvLlenguaTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/btvNoticiesTw b/jenkins/btvNoticiesTw index e853a85..ffe9a20 100644 --- a/jenkins/btvNoticiesTw +++ b/jenkins/btvNoticiesTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/comedygoldbcnTw b/jenkins/comedygoldbcnTw index 86585c9..08ba742 100644 --- a/jenkins/comedygoldbcnTw +++ b/jenkins/comedygoldbcnTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/crunchyTw b/jenkins/crunchyTw index e6d3564..5d0ba2d 100644 --- a/jenkins/crunchyTw +++ b/jenkins/crunchyTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/elRacoDelMangaTw b/jenkins/elRacoDelMangaTw index f912177..577d814 100644 --- a/jenkins/elRacoDelMangaTw +++ b/jenkins/elRacoDelMangaTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/elmonaRAC1Tw b/jenkins/elmonaRAC1Tw index b149d99..d088429 100644 --- a/jenkins/elmonaRAC1Tw +++ b/jenkins/elmonaRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/emergenciescatTw b/jenkins/emergenciescatTw index 38537de..48fd4fc 100644 --- a/jenkins/emergenciescatTw +++ b/jenkins/emergenciescatTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/esport3Tw b/jenkins/esport3Tw index 607a1a2..bc5a168 100644 --- a/jenkins/esport3Tw +++ b/jenkins/esport3Tw @@ -13,10 +13,9 @@ pipeline { } stages { - + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/esportsRAC1Tw b/jenkins/esportsRAC1Tw index ccb7854..a92f29a 100644 --- a/jenkins/esportsRAC1Tw +++ b/jenkins/esportsRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/esportsenxarxaTw b/jenkins/esportsenxarxaTw index 8fe75dd..c4fb17f 100644 --- a/jenkins/esportsenxarxaTw +++ b/jenkins/esportsenxarxaTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcbarcelonaCatTw b/jenkins/fcbarcelonaCatTw index 5214a3c..7f1f93e 100644 --- a/jenkins/fcbarcelonaCatTw +++ b/jenkins/fcbarcelonaCatTw @@ -13,10 +13,9 @@ pipeline { } stages { - + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcbarcelonaTw b/jenkins/fcbarcelonaTw index 1464807..a091ad8 100644 --- a/jenkins/fcbarcelonaTw +++ b/jenkins/fcbarcelonaTw @@ -13,10 +13,9 @@ pipeline { } stages { - + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcbatleticTw b/jenkins/fcbatleticTw index 238c2e8..1c4f5fe 100644 --- a/jenkins/fcbatleticTw +++ b/jenkins/fcbatleticTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcbbasketTw b/jenkins/fcbbasketTw index 9c8c8f4..08e623c 100644 --- a/jenkins/fcbbasketTw +++ b/jenkins/fcbbasketTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/fcbfemeniTw b/jenkins/fcbfemeniTw index 6d45d44..36f0d22 100644 --- a/jenkins/fcbfemeniTw +++ b/jenkins/fcbfemeniTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/jijantesFC b/jenkins/jijantesFC index 6dd0b2f..d37ddfd 100644 --- a/jenkins/jijantesFC +++ b/jenkins/jijantesFC @@ -2,7 +2,7 @@ pipeline { agent any options { - timeout(time: 20, unit: 'MINUTES') + timeout(time: 15, unit: 'MINUTES') timestamps() buildDiscarder(logRotator(numToKeepStr: '10')) disableConcurrentBuilds() @@ -12,13 +12,8 @@ pipeline { cron('H/30 * * * *') } - environment { - VENV_DIR = 'venv' - PIP_CACHE_DIR = "${WORKSPACE}/.pip-cache" - PYTHONUNBUFFERED = '1' - } - stages { + stage('Checkout Code') { steps { checkout scm @@ -28,14 +23,16 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -euxo pipefail + set -e + cd "$WORKSPACE" - python3 -m venv "${VENV_DIR}" + # Crea el venv + python3 -m venv venv - # Always use venv python explicitly - "${VENV_DIR}/bin/python" -m pip install --upgrade pip wheel setuptools + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools - "${VENV_DIR}/bin/pip" install --cache-dir "${PIP_CACHE_DIR}" -U \ + "$WORKSPACE/venv/bin/python3" -m pip install -U \ atproto \ tweety-ns \ playwright \ @@ -43,21 +40,24 @@ pipeline { arrow \ python-dotenv \ moviepy \ - fastfeedparser \ - beautifulsoup4 \ - charset-normalizer \ - Pillow \ grapheme - # Verify required imports - "${VENV_DIR}/bin/python" -c "import fastfeedparser; print('fastfeedparser OK')" - "${VENV_DIR}/bin/python" -c "import moviepy; print('moviepy OK')" + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } - # Check FFmpeg - ffmpeg -version + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } - # Install Playwright browser binaries in this workspace environment - "${VENV_DIR}/bin/python" -m playwright install chromium + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/laCompetenciaRAC1Tw b/jenkins/laCompetenciaRAC1Tw index 1d96da7..55ed4e9 100644 --- a/jenkins/laCompetenciaRAC1Tw +++ b/jenkins/laCompetenciaRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/laxarxamesTw b/jenkins/laxarxamesTw index 5c30393..6417990 100644 --- a/jenkins/laxarxamesTw +++ b/jenkins/laxarxamesTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/meteoRAC1Tw b/jenkins/meteoRAC1Tw index 2159a17..8e9927a 100644 --- a/jenkins/meteoRAC1Tw +++ b/jenkins/meteoRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/meteocatTw b/jenkins/meteocatTw index 2923dce..39b790e 100644 --- a/jenkins/meteocatTw +++ b/jenkins/meteocatTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,31 +23,45 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - + stage('Run Script') { steps { // Securely inject Jenkins credentials as environment variables diff --git a/jenkins/mossosTw b/jenkins/mossosTw index 696f04d..9861307 100644 --- a/jenkins/mossosTw +++ b/jenkins/mossosTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/nohoseRAC1Tw b/jenkins/nohoseRAC1Tw index a3fee68..196f8dd 100644 --- a/jenkins/nohoseRAC1Tw +++ b/jenkins/nohoseRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/optimotTw b/jenkins/optimotTw index b5ed4e8..42a39b0 100644 --- a/jenkins/optimotTw +++ b/jenkins/optimotTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/polonia3CatTw b/jenkins/polonia3CatTw index 856bd95..2539add 100644 --- a/jenkins/polonia3CatTw +++ b/jenkins/polonia3CatTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/semgencatTw b/jenkins/semgencatTw index 0e59985..c954960 100644 --- a/jenkins/semgencatTw +++ b/jenkins/semgencatTw @@ -13,10 +13,9 @@ pipeline { } stages { - + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/transitTw b/jenkins/transitTw index a0690bb..ebd7f72 100644 --- a/jenkins/transitTw +++ b/jenkins/transitTw @@ -16,7 +16,6 @@ pipeline { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -24,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/versioRac1MergedTw b/jenkins/versioRac1MergedTw index 4471de4..7059c3a 100644 --- a/jenkins/versioRac1MergedTw +++ b/jenkins/versioRac1MergedTw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,27 +23,41 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } diff --git a/jenkins/vialliureRAC1Tw b/jenkins/vialliureRAC1Tw index f727723..552e680 100644 --- a/jenkins/vialliureRAC1Tw +++ b/jenkins/vialliureRAC1Tw @@ -13,9 +13,9 @@ pipeline { } stages { + stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -23,31 +23,45 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' - set -e # Exit immediately if a command exits with a non-zero status - - # Create a virtual environment named 'venv' - python3 -m venv venv - - # Activate the virtual environment and install dependencies - . venv/bin/activate && \ - pip install --upgrade pip && \ - pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme - - # Check if moviepy is installed - pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; } - - # Check if FFmpeg is installed - ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; } + set -e + cd "$WORKSPACE" - # Verify that moviepy can be imported - python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; } + # Crea el venv + python3 -m venv venv - # Install the local browser binaries for this environment - playwright install chromium + # Usa python3 -m pip per evitar problemes de shebang amb sh/dash + "$WORKSPACE/venv/bin/python3" -m pip install --upgrade pip wheel setuptools + + "$WORKSPACE/venv/bin/python3" -m pip install -U \ + atproto \ + tweety-ns \ + playwright \ + httpx \ + arrow \ + python-dotenv \ + moviepy \ + grapheme + + # Verificació moviepy + "$WORKSPACE/venv/bin/python3" -m pip list | grep moviepy \ + || { echo 'MoviePy installation failed!'; exit 1; } + + # Verificació FFmpeg + ffmpeg -version \ + || { echo 'FFmpeg is not installed!'; exit 1; } + + # Verificació imports + "$WORKSPACE/venv/bin/python3" -c "import moviepy; print('moviepy OK')" + "$WORKSPACE/venv/bin/python3" -c "import atproto; print('atproto OK')" + "$WORKSPACE/venv/bin/python3" -c "import playwright; print('playwright OK')" + + # Instal·lació binaris Playwright + PLAYWRIGHT_BROWSERS_PATH=/var/jenkins_home/.playwright-browsers \ + "$WORKSPACE/venv/bin/python3" -m playwright install chromium ''' } } - + stage('Run Script') { steps { // Securely injects Jenkins credentials as environment variables