-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkins.txt
More file actions
55 lines (47 loc) · 1.23 KB
/
Jenkins.txt
File metadata and controls
55 lines (47 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline {
agent any
tools {
nodejs 'NodeJS_20' // Make sure Jenkins has this configured in Global Tools
}
environment {
HOME = "${env.WORKSPACE}"
}
stages {
stage('Checkout') {
steps {
git url: 'https://github.com/Indra512/PlaywrightCucumberTypeScript.git'
}
}
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Build TypeScript') {
steps {
sh 'npx tsc'
}
}
stage('Run Tests') {
steps {
sh 'npx cucumber-js'
}
}
stage('Archive Reports') {
steps {
junit 'reports/*.xml' // if you generate JUnit XML reports
}
}
}
post {
always {
echo 'Cleaning up workspace...'
cleanWs()
}
failure {
mail to: 'mapleclub512@gmail.com',
subject: "Jenkins Build Failed: ${env.JOB_NAME} [${env.BUILD_NUMBER}]",
body: "Check Jenkins for details: ${env.BUILD_URL}"
}
}
}