-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rishabh Singh <[email protected]>
- Loading branch information
1 parent
248b7a2
commit b9b0953
Showing
3 changed files
with
185 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
pipeline { | ||
agent none | ||
|
||
stages { | ||
stage('Parallel Builds') { | ||
parallel { | ||
stage('Build Frontend') { | ||
agent {label 'Jenkins-Agent-AL2023-X64-M54xlarge-Docker-Host'} | ||
steps { | ||
script { | ||
// Simulate frontend build | ||
echo "Starting Frontend Build..." | ||
sleep 30 // Simulate work | ||
sh ''' | ||
echo "Installing npm packages..." | ||
echo "Building frontend assets..." | ||
echo "Running frontend tests..." | ||
''' | ||
} | ||
} | ||
post { | ||
success { | ||
echo "Frontend build completed successfully" | ||
} | ||
failure { | ||
echo "Frontend build failed" | ||
} | ||
} | ||
} | ||
|
||
stage('Build Backend') { | ||
agent {label 'Jenkins-Agent-AL2023-X64-M54xlarge-Docker-Host'} | ||
steps { | ||
script { | ||
// Simulate backend build | ||
echo "Starting Backend Build..." | ||
sleep 45 // Simulate work | ||
sh ''' | ||
echo "Compiling backend code..." | ||
echo "Running database migrations..." | ||
echo "Running backend tests..." | ||
''' | ||
} | ||
} | ||
post { | ||
success { | ||
echo "Backend build completed successfully" | ||
} | ||
failure { | ||
echo "Backend build failed" | ||
} | ||
} | ||
} | ||
|
||
stage('Run Integration Tests') { | ||
agent {label 'Jenkins-Agent-AL2023-X64-M54xlarge-Docker-Host'} | ||
steps { | ||
script { | ||
def workflowRun = org.jenkinsci.plugins.workflow.job.WorkflowRun | ||
def flowExecution = org.jenkinsci.plugins.workflow.flow.FlowExecution | ||
|
||
def rawBuild = currentBuild.rawBuild | ||
if (rawBuild instanceof workflowRun) { | ||
def exec = rawBuild.getExecution() | ||
println "Pipeline execution: ${exec}" | ||
} | ||
} | ||
} | ||
post { | ||
success { | ||
echo "Integration tests completed successfully" | ||
} | ||
failure { | ||
echo "Integration tests failed" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
echo "Pipeline completed - cleaning up..." | ||
} | ||
success { | ||
echo "All parallel stages completed successfully!" | ||
} | ||
failure { | ||
echo "One or more stages failed!" | ||
} | ||
} | ||
} |