forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Jenkinsfile
52 lines (45 loc) · 1.04 KB
/
Jenkinsfile
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
pipeline {
agent any
tools {
nodejs "NodeJS" // Reference to the NodeJS tool defined in Jenkins
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/randihaboc/create-react-app.git' // Replace with your repository URL
}
}
stage('Install Dependencies') {
steps {
sh 'npm install'
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Test') {
steps {
sh 'npm test -- --watchAll=false'
}
}
stage('Deploy') {
steps {
echo 'Deploying React app...'
// Add deployment steps here if necessary
}
}
}
post {
always {
echo 'Pipeline finished.'
}
success {
echo 'Build successful!'
}
failure {
echo 'Build failed.'
}
}
}