Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c83174f2c2 | ||
|
|
0465bde401 | ||
|
|
c815e53fc2 | ||
|
|
615fcb396a | ||
|
|
d4c012560d |
Vendored
+5
@@ -160,6 +160,11 @@ pipeline {
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
export DOCKER_CONFIG="$WORKSPACE/.docker-publish"
|
export DOCKER_CONFIG="$WORKSPACE/.docker-publish"
|
||||||
printf '%s' "$REG_TOKEN" | docker login "$REGISTRY" -u "$REG_USER" --password-stdin
|
printf '%s' "$REG_TOKEN" | docker login "$REGISTRY" -u "$REG_USER" --password-stdin
|
||||||
|
# Releases are immutable: never overwrite an existing tag (see Chapter 6, rollback incident).
|
||||||
|
if docker manifest inspect "$IMAGE:$COMMIT" >/dev/null 2>&1; then
|
||||||
|
echo "ERROR: $IMAGE:$COMMIT is already published; releases are immutable. Use MODE=redeploy with the committed record." >&2
|
||||||
|
docker logout "$REGISTRY"; exit 1
|
||||||
|
fi
|
||||||
docker push "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-push.log
|
docker push "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-push.log
|
||||||
docker rmi "$IMAGE:$COMMIT"
|
docker rmi "$IMAGE:$COMMIT"
|
||||||
docker pull "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-pull.log
|
docker pull "$IMAGE:$COMMIT" 2>&1 | tee reports/docker-pull.log
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@ import os
|
|||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
VERSION = "v1"
|
VERSION = "v2"
|
||||||
UNIT_PRICE = 10
|
UNIT_PRICE = 12
|
||||||
COMMIT = os.environ.get("APP_COMMIT", "development")
|
COMMIT = os.environ.get("APP_COMMIT", "development")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,17 @@ class PricingTests(unittest.TestCase):
|
|||||||
self.client = app.test_client()
|
self.client = app.test_client()
|
||||||
|
|
||||||
def test_price(self):
|
def test_price(self):
|
||||||
self.assertEqual(total_price(3), 30)
|
self.assertEqual(total_price(3), 36)
|
||||||
response = self.client.get("/price?quantity=3")
|
response = self.client.get("/price?quantity=3")
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(response.json["total"], 30)
|
self.assertEqual(response.json["total"], 36)
|
||||||
|
|
||||||
def test_invalid_quantity(self):
|
def test_invalid_quantity(self):
|
||||||
for value in ["0", "-1", "1001", "abc", "1.5"]:
|
for value in ["0", "-1", "1001", "abc", "1.5"]:
|
||||||
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
|
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
|
||||||
|
|
||||||
def test_release_identity(self):
|
def test_release_identity(self):
|
||||||
self.assertEqual(self.client.get("/").json["version"], "v1")
|
self.assertEqual(self.client.get("/").json["version"], "v2")
|
||||||
self.assertEqual(self.client.get("/health").json["status"], "ok")
|
self.assertEqual(self.client.get("/health").json["status"], "ok")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Release record: v1 production. Metadata only; no credentials.
|
||||||
|
# Corrected 2026-11-12: the original v1 image (sha256:3c0d12eb..., Jenkins #7) was overwritten in
|
||||||
|
# the registry when Jenkins #10 rebuilt the same commit and re-pushed the same tag. This digest is
|
||||||
|
# that rebuild of the same reviewed source commit; it passed every gate and the staging smoke test in #10.
|
||||||
|
target_env: production
|
||||||
|
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:d4d894df4634b088e6d52cbae2128510a05d0e4e1d972f4d64ba959423c07c97
|
||||||
|
expected_version: v1
|
||||||
|
expected_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
|
||||||
|
expected_total: 30
|
||||||
|
public_url: https://app.ssw590.abrdns.com
|
||||||
|
proxy_network: startup_private
|
||||||
|
config_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
|
||||||
|
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/10/
|
||||||
|
recorded_at: 2026-11-12, see Jenkins #10
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Release record: v1 staging. Metadata only; no credentials.
|
||||||
|
# Corrected 2026-11-12: the original v1 image (sha256:3c0d12eb..., Jenkins #7) was overwritten in
|
||||||
|
# the registry when Jenkins #10 rebuilt the same commit and re-pushed the same tag. This digest is
|
||||||
|
# that rebuild of the same reviewed source commit; it passed every gate and the staging smoke test in #10.
|
||||||
|
target_env: staging
|
||||||
|
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:d4d894df4634b088e6d52cbae2128510a05d0e4e1d972f4d64ba959423c07c97
|
||||||
|
expected_version: v1
|
||||||
|
expected_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
|
||||||
|
expected_total: 30
|
||||||
|
public_url: https://staging.ssw590.abrdns.com
|
||||||
|
proxy_network: startup_private
|
||||||
|
config_commit: d4c012560d5096f399224d5b5f6516a5cb2158a4
|
||||||
|
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/10/
|
||||||
|
recorded_at: 2026-11-12, see Jenkins #10
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Release record: v2 production. Metadata only; no credentials.
|
||||||
|
target_env: production
|
||||||
|
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:adf58a4abcb03be98cce394d5fde1794ae77525d2e1882a8be3c59c8c3556d92
|
||||||
|
expected_version: v2
|
||||||
|
expected_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
|
||||||
|
expected_total: 36
|
||||||
|
public_url: https://app.ssw590.abrdns.com
|
||||||
|
proxy_network: startup_private
|
||||||
|
config_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
|
||||||
|
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/11/
|
||||||
|
recorded_at: 2026-11-12, see Jenkins #11
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Release record: v2 staging. Metadata only; no credentials.
|
||||||
|
target_env: staging
|
||||||
|
release_image: git.ssw590.abrdns.com/startupteam/pricing@sha256:adf58a4abcb03be98cce394d5fde1794ae77525d2e1882a8be3c59c8c3556d92
|
||||||
|
expected_version: v2
|
||||||
|
expected_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
|
||||||
|
expected_total: 36
|
||||||
|
public_url: https://staging.ssw590.abrdns.com
|
||||||
|
proxy_network: startup_private
|
||||||
|
config_commit: 0465bde4017a3d1f9e3b523dcdc065154789cad7
|
||||||
|
jenkins_build: https://ci.ssw590.abrdns.com/job/pricing-delivery/11/
|
||||||
|
recorded_at: 2026-11-12, see Jenkins #11
|
||||||
Reference in New Issue
Block a user