Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 44 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
pipeline {

agent any

stages {

stage('Install Dependencies') {
steps {
sh 'npm install'
pipeline {
agent any

stages {
stage('Checkout') {
steps {
// Checkout code from the Git repository
script {
checkout scm
}
}
}
}

stage('Test') {
steps {
sh 'echo "testing application..."'

stage('Build') {
steps {
// Build the project (Replace 'your_build_command' with the actual build command)
script {
sh 'your_build_command'
}
}
}
}

stage("Deploy application") {
steps {
sh 'echo "deploying application..."'
}

}

}

}

stage('Test') {
steps {
// Run tests (Replace 'your_test_command' with the actual test command)
script {
sh 'your_test_command'
}
}
}
}

post {
success {
// Actions to be taken if the build is successful
echo 'Build successful! Deploying...'
// Add deployment steps or other post-build actions here
}

failure {
// Actions to be taken if the build fails
echo 'Build failed! Not deploying.'
// Add failure handling or notifications here
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build and Deploy nodejs application on EC2 instance - Freestyle
# Build and Deploy nodejs application on EC2 instance - FreestyleS

# Pre-requisites

Expand Down