Skip to content

Commit 165cbf2

Browse files
committed
minor fixed
1 parent c5c5db9 commit 165cbf2

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ target/
2222
.springBeans
2323
.sts4-cache
2424

25-
.ENV
2625
.env
2726

27+
allure-results/
28+
allure-results
29+
allure-report
30+
allure-report/
31+
32+
2833
### NetBeans ###
2934
/nbproject/private/
3035
/nbbuild/

Jenkinsfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
pipeline {
2+
agent any
3+
4+
environment {
5+
// Jenkins credentials IDs for Docker Hub and SonarQube token
6+
DOCKER_USERNAME = credentials('dockerhub-username')
7+
DOCKER_PASSWORD = credentials('dockerhub-password')
8+
SONAR_TOKEN = credentials('sonarqube-token')
9+
10+
ALLURE_RESULTS = 'target/allure-results'
11+
ALLURE_REPORT = 'target/allure-report'
12+
13+
IMAGE_NAME = "yourdockerhubusername/selenium-framework"
14+
IMAGE_TAG = "${env.BUILD_NUMBER}"
15+
}
16+
stages {
17+
stage('Checkout Code') {
18+
steps {
19+
git url: 'https://github.com/m-amaann/automation-selenium-framework.git', branch: 'main'
20+
}
21+
}
22+
stage('Clean Workspace & Reports') {
23+
steps {
24+
sh 'mvn clean'
25+
sh "rm -rf ${ALLURE_RESULTS} ${ALLURE_REPORT}"
26+
}
27+
}
28+
stage('Run Tests') {
29+
steps {
30+
sh 'mvn test'
31+
}
32+
}
33+
stage('Generate Allure Report') {
34+
steps {
35+
sh "allure generate ${ALLURE_RESULTS} --clean -o ${ALLURE_REPORT}"
36+
}
37+
}
38+
stage('Archive & Publish Report') {
39+
steps {
40+
archiveArtifacts artifacts: "${ALLURE_REPORT}/**", fingerprint: true
41+
allure includeProperties: false, results: [[path: "${ALLURE_RESULTS}"]]
42+
}
43+
}
44+
}
45+
post {
46+
always {
47+
junit 'target/surefire-reports/*.xml'
48+
}
49+
}
50+
}
51+
52+
53+

0 commit comments

Comments
 (0)