forked from Nalini8123/project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassign5
More file actions
34 lines (31 loc) · 1.1 KB
/
assign5
File metadata and controls
34 lines (31 loc) · 1.1 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
pipeline {
agent any
stages {
stage('Set Message') {
steps {
script {
// Define a message in this stage
def message = 5*4
// Pass the message to the next stage by setting it as an environment variable
env.MESSAGE = message
echo "Message set: ${env.MESSAGE}"
}
}
}
stage('Decision Stage') {
steps {
script {
// Retrieve the message passed from the previous stage
def receivedMessage = env.MESSAGE
// Perform a decision based on the message
if (receivedMessage == "20") {
echo "The message is correct. Proceeding with the task."
// Here you can perform an action based on the message
} else {
echo "The message is incorrect. Skipping the task."
}
}
}
}
}
}