feat: complete secure pricing delivery and rollback documentation
This commit is contained in:
Vendored
+74
-2
@@ -1,9 +1,10 @@
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timeout(time: 5, unit: 'MINUTES')
|
||||
timeout(time: 10, unit: 'MINUTES')
|
||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||
}
|
||||
|
||||
@@ -36,12 +37,83 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Verify Python') {
|
||||
steps {
|
||||
sh 'python3 --version'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Staging Health Check') {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
|
||||
curl -fsS --max-time 10 \
|
||||
http://startup-pricing-staging:5000/health \
|
||||
-o /tmp/pricing-health.json
|
||||
|
||||
python3 -c '
|
||||
import json
|
||||
|
||||
with open("/tmp/pricing-health.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
assert data["status"] == "healthy"
|
||||
assert data["version"] == "v2"
|
||||
|
||||
print("Staging health check PASSED")
|
||||
print("Version:", data["version"])
|
||||
'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Staging Pricing Smoke Test') {
|
||||
steps {
|
||||
sh '''
|
||||
set -eu
|
||||
|
||||
curl -fsS --max-time 10 \
|
||||
http://startup-pricing-staging:5000/pricing \
|
||||
-o /tmp/pricing-response.json
|
||||
|
||||
python3 -c '
|
||||
import json
|
||||
|
||||
with open("/tmp/pricing-response.json") as f:
|
||||
data = json.load(f)
|
||||
|
||||
assert data["version"] == "v2"
|
||||
|
||||
plans = data["plans"]
|
||||
expected = {
|
||||
"Starter": 5,
|
||||
"Basic": 12,
|
||||
"Pro": 30,
|
||||
"Enterprise": 60
|
||||
}
|
||||
|
||||
actual = {
|
||||
plan["name"]: plan["price"]
|
||||
for plan in plans
|
||||
}
|
||||
|
||||
assert actual == expected
|
||||
|
||||
print("Pricing smoke test PASSED")
|
||||
print("All four pricing plans verified")
|
||||
'
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
echo 'CI PASSED: All checks completed successfully.'
|
||||
echo 'CI PASSED: Node.js tests and staging smoke tests completed.'
|
||||
}
|
||||
|
||||
failure {
|
||||
echo 'CI FAILED: Review the Jenkins console output.'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user