diff --git a/jenkins_build.xml b/jenkins_build.xml new file mode 100644 index 0000000..eb9dc38 --- /dev/null +++ b/jenkins_build.xml @@ -0,0 +1,43 @@ + + + Build job - compiles and packages the application + false + + + + + https://gittea.cloud-handson.com/joungmin/openclaw-workspace.git + gitea-credentials + + + + + */main + + + false + + + + built-in + + + python3 -m venv venv +. venv/bin/activate +pip install --upgrade pip +pip install pylint flake8 black isort oracledb pytest pytest-cov + + + . venv/bin/activate +pip freeze > requirements.locked.txt + + + + + *.py,requirements*.txt + true + true + + + + diff --git a/jenkins_deploy.xml b/jenkins_deploy.xml new file mode 100644 index 0000000..20d33ad --- /dev/null +++ b/jenkins_deploy.xml @@ -0,0 +1,44 @@ + + + Deploy job - deploys Habit Bot to Ubuntu server + false + + + + + https://gittea.cloud-handson.com/joungmin/openclaw-workspace.git + gitea-credentials + + + + + */main + + + false + + + + built-in + + + # Stop existing bot +ssh joungmin@192.168.0.147 "pkill -f habit_bot.py || true" + +# Copy files +scp habit_bot.py requirements.txt joungmin@192.168.0.147:/home/joungmin/habit_bot/ + +# Install dependencies +ssh joungmin@192.168.0.147 "cd /home/joungmin/habit_bot && source venv/bin/activate && pip install -q -r requirements.txt" + +# Restart bot +ssh joungmin@192.168.0.147 "cd /home/joungmin/habit_bot && source venv/bin/activate && TELEGRAM_BOT_TOKEN=8325588419:AAGghb0nosWG8g6QtYeghqUs0RHug06uG74 nohup python habit_bot.py > bot.log 2>&1 &" + +# Verify +sleep 3 +ssh joungmin@192.168.0.147 "ps aux | grep habit_bot | grep -v grep" + + + + + diff --git a/jenkins_test.xml b/jenkins_test.xml new file mode 100644 index 0000000..02818cb --- /dev/null +++ b/jenkins_test.xml @@ -0,0 +1,41 @@ + + + Test job - runs all unit tests + false + + + + + https://gittea.cloud-handson.com/joungmin/openclaw-workspace.git + gitea-credentials + + + + + */main + + + false + + + + built-in + + + python3 -m venv venv +. venv/bin/activate +pip install -r test_requirements.txt + + + + + test-results.xml + true + + + . venv/bin/activate +pytest tests/ -v --junitxml=test-results.xml --cov=. --cov-report=html + + + +