Refacere repo

This commit is contained in:
Ionel Andrei Cataon
2026-02-12 14:14:46 +02:00
parent 002d53928a
commit ad4a4cf8f6
1059 changed files with 193216 additions and 1 deletions

16
project1/checker.py Normal file
View File

@@ -0,0 +1,16 @@
import requests
import sys
def check_site(url):
try:
response = requests.get(url, timeout=5)
if response.status_code == 200:
print(f"✅ Succes! {url} este online.")
else:
print(f"⚠️ Atentie! {url} a raspuns cu status: {response.status_code}")
except Exception as e:
print(f"❌ Eroare: Nu am putut accesa {url}. Motiv: {e}")
sys.exit(1)
if __name__ == "__main__":
check_site("https://www.youtube.com/")

14
project1/dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.11
# Setez directorul de lucru in container
WORKDIR /the/workdir/path
# Copiez fisierul de requirements in container
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copiez restul codului sursa in container
COPY checker.py .
# Comanda de rulare a aplicatiei
CMD ["python", "checker.py"]

30
project1/jenkinsfile Normal file
View File

@@ -0,0 +1,30 @@
pipeline {
agent any
stages {
stage('Checkout') {
steps {
// Jenkins va prelua codul sursă din depozitul Git
echo 'Se descarca codul...'
}
}
stage('Build Docker Image') {
steps {
script {
// Construim imaginea și îi dăm un nume (tag)
sh 'docker build -t web-checker-app .'
}
}
}
stage('Run Checker') {
steps {
script {
// Rulăm containerul
sh 'docker run --rm web-checker-app'
}
}
}
}
}

View File

@@ -0,0 +1 @@
requests==2.31.0