init
This commit is contained in:
parent
f4476af611
commit
5ddf0baa2f
@ -17,7 +17,7 @@ spec:
|
|||||||
results:
|
results:
|
||||||
- name: specDoamin
|
- name: specDoamin
|
||||||
description: Extracted domain name (e.g. user)
|
description: Extracted domain name (e.g. user)
|
||||||
- name: version
|
- name: specVersion
|
||||||
description: Extracted project version (e.g. 0.2.0)
|
description: Extracted project version (e.g. 0.2.0)
|
||||||
steps:
|
steps:
|
||||||
- name: verify-version
|
- name: verify-version
|
||||||
@ -31,10 +31,10 @@ spec:
|
|||||||
|
|
||||||
echo "🔍 Extracting tag from Git ref..."
|
echo "🔍 Extracting tag from Git ref..."
|
||||||
FULL_REF="$(params.ref)"
|
FULL_REF="$(params.ref)"
|
||||||
DOMAIN_FROM_REF=$(echo "$FULL_REF" | awk -F'[/-]' '{print $2}')
|
DOMAIN=$(echo "$FULL_REF" | awk -F'[/-]' '{print $2}')
|
||||||
TAG_FROM_REF=$(basename "$FULL_REF") # → 0.2.0
|
TAG_FROM_REF=$(basename "$FULL_REF") # → 0.2.0
|
||||||
|
|
||||||
OPENAPI_FILE="specs/${DOMAIN_FROM_REF}/openapi.yaml"
|
OPENAPI_FILE="specs/${DOMAIN}/openapi.yaml"
|
||||||
echo "📄 Reading version from openapi.yaml of ${OPENAPI_FILE}..."
|
echo "📄 Reading version from openapi.yaml of ${OPENAPI_FILE}..."
|
||||||
VERSION=$(yq '.info.version' "$OPENAPI_FILE")
|
VERSION=$(yq '.info.version' "$OPENAPI_FILE")
|
||||||
TAG_FROM_OPENAPI="${VERSION}"
|
TAG_FROM_OPENAPI="${VERSION}"
|
||||||
@ -49,5 +49,5 @@ spec:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✅ Tag and version match: $VERSION"
|
echo "✅ Tag and version match: $VERSION"
|
||||||
echo -n "$DOMAIN_FROM_REF" > /tekton/results/specDoamin
|
echo -n "$DOMAIN" > /tekton/results/specDoamin
|
||||||
echo -n "$VERSION" > /tekton/results/version
|
echo -n "$VERSION" > /tekton/results/specVersion
|
Loading…
x
Reference in New Issue
Block a user