Skip to content

Commit 2df7331

Browse files
Allow Stage Insight (#18)
* adapt stage options * fix condition * update workflow branches * add double quotes for testing * remove lint error * remove /g * revert branches * ignore temporarily
1 parent 3d5649f commit 2df7331

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.github/actions/get-product-parameters/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ runs:
8181
stage=develop
8282
if [[ $BRANCH_NAME == main* || $BRANCH_NAME == rc-* || $BRANCH_NAME == v[0-9]* ]] ; then
8383
stage=production
84+
elif [[ $BRANCH_NAME == insight* ]] ; then
85+
stage=insight
8486
fi
8587
# get image tags
8688
build_time=$(TZ=$TIME_ZONE date +%Y-%m-%dT%H%M%SZ)

.github/actions/lint-docker/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cp /hadolint-matcher.json "$HOME/"
55
# remove matcher during cleanup
66
cleanup() {
7+
# shellcheck disable=SC2317
78
echo "::remove-matcher owner=datavisyn/lint-docker::"
89
}
910
trap cleanup EXIT

.github/workflows/build-single-product-part.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ jobs:
178178
stage_str=".dev"
179179
if [[ $STAGE == "production" ]]; then
180180
stage_str=".prod"
181+
elif [[ $STAGE == "insight" ]]; then
182+
stage_str=".insight"
181183
fi
182184
echo "$stage_str"
183185
if [[ -f "$COMPONENT_DIRECTORY/.env" ]]; then

.github/workflows/build-workspace-product-part.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,18 @@ jobs:
193193
194194
if [[ $product_version == *"SNAPSHOT"* ]]; then
195195
echo "replace SNAPSHOT in version with timestamp"
196-
product_version=$(echo "$product_version" | sed "s/SNAPSHOT/$(date +%Y%m%d-%H%M%S)/g")
196+
product_version="${product_version//SNAPSHOT/$(date +%Y%m%d-%H%M%S)}"
197197
echo "product_version=$product_version"
198198
fi
199199
200-
workspace_version=$(jq -rc '.version' ./tmp/$COMPONENT/package.json)
200+
workspace_version=$(jq -rc '.version' "./tmp/$COMPONENT/package.json")
201201
echo "workspace_version=$workspace_version"
202202
203-
if [[ $product_version != $workspace_version ]]; then
203+
if [[ "$product_version" != "$workspace_version" ]]; then
204204
echo "update workspace version"
205-
jq --arg version "$product_version" '.version = $version' ./tmp/$COMPONENT/package.json > ./tmp/$COMPONENT/package.json.tmp
206-
mv ./tmp/$COMPONENT/package.json.tmp ./tmp/$COMPONENT/package.json
207-
echo "workspace version updated to $(jq -rc '.version' ./tmp/$COMPONENT/package.json)"
205+
jq --arg version "$product_version" '.version = $version' "./tmp/$COMPONENT/package.json" > "./tmp/$COMPONENT/package.json.tmp"
206+
mv "./tmp/$COMPONENT/package.json.tmp" "./tmp/$COMPONENT/package.json"
207+
echo "workspace version updated to $(jq -rc '.version' './tmp/$COMPONENT/package.json')"
208208
fi
209209
env:
210210
COMPONENT: ${{ inputs.component }}
@@ -225,8 +225,10 @@ jobs:
225225
if: ${{ steps.get-parameters.outputs.type == 'web' }}
226226
run: |
227227
stage_str=".dev"
228-
if [[ $STAGE == "production" ]]; then
228+
if [[ "$STAGE" == "production" ]]; then
229229
stage_str=".prod"
230+
elif [[ "$STAGE" == "insight" ]]; then
231+
stage_str=".insight"
230232
fi
231233
echo "$stage_str"
232234
if [[ -f "$COMPONENT_DIRECTORY/.env" ]]; then

.github/workflows/deploy-product.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
inputs:
2222
stage:
23-
description: "stage that should be deployed (develop|qa|production)"
23+
description: "stage that should be deployed (develop|qa|production|insight)"
2424
required: true
2525
type: string
2626
customer:

0 commit comments

Comments
 (0)