Skip to content

Commit

Permalink
[CI] Add check cooldown for release
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Kramorov <[email protected]>
  • Loading branch information
Kirill Kramorov committed Sep 4, 2024
1 parent 9353af8 commit c02818b
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflow_templates/deploy-channel.multi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,22 @@ Jobs for visual control allowed editions when approving deploy to environments.
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
{!{ range $werfEnv := slice "CE" "EE" "FE" "BE" "SE" }!}
- name: Set cooldown for release ({!{ $werfEnv }!})
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/deploy-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,22 @@ jobs:
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
- name: Set cooldown for release (CE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -357,6 +371,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (EE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -378,6 +394,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (FE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -399,6 +417,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (BE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -420,6 +440,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (SE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,22 @@ jobs:
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
- name: Set cooldown for release (CE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -357,6 +371,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (EE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -378,6 +394,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (FE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -399,6 +417,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (BE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -420,6 +440,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (SE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/deploy-early-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,22 @@ jobs:
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
- name: Set cooldown for release (CE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -357,6 +371,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (EE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -378,6 +394,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (FE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -399,6 +417,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (BE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -420,6 +440,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (SE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/deploy-rock-solid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,22 @@ jobs:
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
- name: Set cooldown for release (CE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -357,6 +371,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (EE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -378,6 +394,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (FE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -399,6 +417,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (BE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -420,6 +440,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (SE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/deploy-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,22 @@ jobs:
echo "enable=true" >> $GITHUB_OUTPUT
fi
- name: Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
COOLDOWN: ${{ github.event.inputs.cooldown }}
run: |
CURRENT_TIMESTAMP=$(date +%s)
COOLDOWN_TIMESTAMP=$(date -u +%s -d "${COOLDOWN}")
if [ "$CURRENT_TIMESTAMP" -gt "$COOLDOWN_TIMESTAMP" ]; then
echo "The cooldown has expired"
exit 1
fi
- name: Set cooldown for release (CE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -357,6 +371,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (EE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -378,6 +394,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (FE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -399,6 +417,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (BE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand All @@ -420,6 +440,8 @@ jobs:
echo "⚓️ 📤 [$(date -u)] Push '${SOURCE_RELEASE_VERSION_IMAGE}' image with cooldown."
docker image push ${SOURCE_RELEASE_VERSION_IMAGE}
- name: Set cooldown for release (SE)
needs:
- Check cooldown for release
if: ${{ github.event.inputs.cooldown }}
env:
DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}}
Expand Down

0 comments on commit c02818b

Please sign in to comment.