-
Notifications
You must be signed in to change notification settings - Fork 1
/
jenkinsfile
34 lines (34 loc) · 986 Bytes
/
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
pipeline {
agent any
tools {nodejs "Node_20"}
parameters {
int(name: 'iterationCount', defaultValue: 1, description: 'Number of iterations for Postman collection run')
string(name: 'baseUrl', defaultValue: 'https://torapi.vercel.app', description: 'Base URL for Postman environment variable')
}
stages {
stage('Install Postman CLI') {
steps {
sh 'curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh'
}
}
stage('Postman CLI Login') {
steps {
script {
if (!env.POSTMAN_API_KEY) {
error "API key not set"
}
}
sh 'postman login --with-api-key $POSTMAN_API_KEY'
}
}
stage('Running collection with iterations') {
steps {
sh """
postman collection run "37302476-23547b25-084c-4b30-bc78-9e72372dc9b8" \
--iteration-count ${params.iterationCount} \
--env-var "baseUrl=${params.baseUrl}"
"""
}
}
}
}