From c9121b4d5c917e3da0cb76870e3a8dc79a9aef1e Mon Sep 17 00:00:00 2001 From: sacha Date: Tue, 20 Jan 2026 22:50:07 +0000 Subject: [PATCH] Initial commit - DevOps test project --- Jenkinsfile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 28 +++++++++++++++++++++++++++ app.sh | 26 +++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 Jenkinsfile create mode 100644 README.md create mode 100644 app.sh diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..58877dd --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,55 @@ +pipeline { + agent any + + environment { + APP_NAME = 'devops-test' + VERSION = '1.0.0' + } + + stages { + stage('Checkout') { + steps { + echo "📦 Cloning repository..." + checkout scm + } + } + + stage('Validate') { + steps { + echo "🔍 Validating scripts..." + sh 'ls -la' + sh 'chmod +x app.sh' + sh 'bash -n app.sh' // Syntax check + } + } + + stage('Test') { + steps { + echo "🧪 Running tests..." + sh './app.sh' + } + } + + stage('Build Info') { + steps { + echo "📊 Build Information:" + echo " App: ${APP_NAME}" + echo " Version: ${VERSION}" + echo " Build: ${BUILD_NUMBER}" + echo " Branch: ${GIT_BRANCH}" + } + } + } + + post { + success { + echo "✅ Pipeline completed successfully!" + } + failure { + echo "❌ Pipeline failed!" + } + always { + echo "🏁 Pipeline finished at ${new Date()}" + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e500553 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# DevOps Test Project 🧪 + +Un simple projet pour tester la chaîne CI/CD : Gitea → Jenkins → Rundeck + +## Structure + +``` +devops-test/ +├── app.sh # Script simple à déployer +├── Jenkinsfile # Pipeline CI/CD +└── README.md # Ce fichier +``` + +## Comment tester + +1. **Push vers Gitea** → déclenche webhook +2. **Jenkins** → build et test automatique +3. **Rundeck** → déploiement (optionnel) + +## Commandes + +```bash +# Clone +git clone https://gitea.sta4ck.eu/admin/devops-test.git + +# Push +git add . && git commit -m "test" && git push +``` diff --git a/app.sh b/app.sh new file mode 100644 index 0000000..4207c01 --- /dev/null +++ b/app.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# app.sh - Simple test application + +echo "================================" +echo " DevOps Test Application" +echo " Version: 1.0.0" +echo " Date: $(date)" +echo "================================" + +# Simulate some work +echo "[INFO] Starting application checks..." +sleep 1 +echo "[OK] Configuration validated" +sleep 1 +echo "[OK] Dependencies checked" +sleep 1 +echo "[OK] Application ready!" + +# Show environment +echo "" +echo "Environment:" +echo " Hostname: $(hostname)" +echo " User: $(whoami)" +echo " PWD: $(pwd)" + +exit 0