Skip to content

Commit

Permalink
Merge pull request #23 from datavisyn/revert-22-new_deplyoment_timeout
Browse files Browse the repository at this point in the history
Revert "added timeout to build product"
  • Loading branch information
puehringer authored Aug 7, 2023
2 parents de44a5b + baf238b commit 3d5649f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: build-product

on:
workflow_call:
inputs:
timeout:
description: "Timeout in minutes for each job"
type: string
default: 30
secrets:
DATAVISYN_BOT_REPO_TOKEN:
required: false
Expand Down Expand Up @@ -63,7 +58,6 @@ jobs:
create_workspace: ${{ steps.get-parameters.outputs.create_workspace }}
stage: ${{ steps.get-parameters.outputs.stage }}
runs-on: ubuntu-20.04
timeout-minutes: ${{ fromJSON(github.event.inputs.timeout) }}
steps:
# checkout specific repository
- uses: actions/checkout@v3
Expand Down Expand Up @@ -106,7 +100,6 @@ jobs:
image_tag2: ${{ needs.prepare-build.outputs.image_tag2 }}
build_time: ${{ needs.prepare-build.outputs.build_time }}
stage: ${{ needs.prepare-build.outputs.stage }}
timeout: ${{ inputs.timeout }}
secrets: inherit
build-workspace:
needs: prepare-build
Expand All @@ -122,11 +115,9 @@ jobs:
image_tag2: ${{ needs.prepare-build.outputs.image_tag2 }}
build_time: ${{ needs.prepare-build.outputs.build_time }}
stage: ${{ needs.prepare-build.outputs.stage }}
timeout: ${{ inputs.timeout }}
secrets: inherit
post-build:
needs: [prepare-build, build-single, build-workspace]
timeout-minutes: ${{ fromJSON(github.event.inputs.timeout) }}
if: ${{ always() && (needs.build-single.result == 'success' || needs.build-single.result == 'skipped') && (needs.build-workspace.result == 'success' || needs.build-workspace.result == 'skipped') && !(needs.build-workspace.result == 'skipped' && needs.build-single.result == 'skipped')}}
runs-on: ubuntu-20.04
steps:
Expand All @@ -148,7 +139,6 @@ jobs:
# Add always() as otherwise the job is being skipped: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
if: ${{ always() && needs.post-build.result == 'success' && fromJSON(needs.prepare-build.outputs.trigger_automatic_deployment) }}
runs-on: ubuntu-20.04
timeout-minutes: ${{ fromJSON(github.event.inputs.timeout) }}
strategy:
matrix:
customer: ${{ fromJSON(needs.prepare-build.outputs.customers) }}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build-single-product-part.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ on:
description: "stage for the image (develop or production) depending on the branch name"
required: true
type: string
timeout:
description: "Timeout in minutes for each job"
type: string
default: 30
env:
TIME_ZONE: "Europe/Vienna"
NODE_VERSION: "16.16"
Expand All @@ -64,7 +60,6 @@ permissions:
jobs:
build-components:
runs-on: ubuntu-20.04
timeout-minutes: ${{ fromJSON(github.event.inputs.timeout) }}
steps:
# checkout specific repository
- uses: actions/checkout@v3
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/build-workspace-product-part.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ on:
description: "stage for the image (develop or production) depending on the branch name"
required: true
type: string
timeout:
description: "Timeout in minutes for each job"
type: string
default: 30
env:
VISYN_SCRIPTS_VERSION: "develop"
TIME_ZONE: "Europe/Vienna"
Expand All @@ -65,7 +61,6 @@ permissions:
jobs:
build-components:
runs-on: ubuntu-20.04
timeout-minutes: ${{ fromJSON(github.event.inputs.timeout) }}
steps:
# checkout specific repository
- uses: actions/checkout@v3
Expand Down Expand Up @@ -196,20 +191,20 @@ jobs:
product_version=$(jq -rc '.version' ./package.json)
echo "product_version=$product_version"
if [[ "$product_version" == *"SNAPSHOT"* ]]; then
if [[ $product_version == *"SNAPSHOT"* ]]; then
echo "replace SNAPSHOT in version with timestamp"
product_version=${product_version/SNAPSHOT/$(date +%Y%m%d-%H%M%S)}
product_version=$(echo "$product_version" | sed "s/SNAPSHOT/$(date +%Y%m%d-%H%M%S)/g")
echo "product_version=$product_version"
fi
workspace_version=$(jq -rc '.version' ./tmp/"$COMPONENT"/package.json)
workspace_version=$(jq -rc '.version' ./tmp/$COMPONENT/package.json)
echo "workspace_version=$workspace_version"
if [[ "$product_version" != "$workspace_version" ]]; then
if [[ $product_version != $workspace_version ]]; then
echo "update workspace version"
jq --arg version "$product_version" '.version = $version' ./tmp/"$COMPONENT"/package.json > ./tmp/"$COMPONENT"/package.json.tmp
mv ./tmp/"$COMPONENT"/package.json.tmp ./tmp/"$COMPONENT"/package.json
echo "workspace version updated to $(jq -rc '.version' ./tmp/"$COMPONENT"/package.json)"
jq --arg version "$product_version" '.version = $version' ./tmp/$COMPONENT/package.json > ./tmp/$COMPONENT/package.json.tmp
mv ./tmp/$COMPONENT/package.json.tmp ./tmp/$COMPONENT/package.json
echo "workspace version updated to $(jq -rc '.version' ./tmp/$COMPONENT/package.json)"
fi
env:
COMPONENT: ${{ inputs.component }}
Expand Down

0 comments on commit 3d5649f

Please sign in to comment.