diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..1f3bd5e1b06 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,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/yuancarlosss/create-react-app' // 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.' + } + } +}