-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add previous channel release version check (#27)
Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com> Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com> Co-authored-by: Aleksandr Zimin <alexandr.zimin@flant.com>
- Loading branch information
1 parent
de4cf45
commit 4030326
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
crane="/usr/local/bin/crane" | ||
repositoryName=$1 | ||
edition=$2 | ||
channel=$3 | ||
version=$4 | ||
|
||
echo "Module $repositoryName, edition $edition, channel $channel, version $version" | ||
|
||
if [[ "$channel" == "alpha" ]]; then | ||
echo "Deploying $version to alpha channel" | ||
exit 0 | ||
elif [[ "$channel" == "beta" ]]; then | ||
previousChannel="alpha" | ||
elif [[ "$channel" == "early-access" ]]; then | ||
previousChannel="beta" | ||
elif [[ "$channel" == "stable" ]]; then | ||
previousChannel="early-access" | ||
elif [[ "$channel" == "rock-solid" ]]; then | ||
previousChannel="stable" | ||
else | ||
echo "Unknown channel" | ||
exit 1 | ||
fi | ||
|
||
echo "Checking previous channel $previousChannel" | ||
previousChannelVersion=$($crane export registry.deckhouse.io/deckhouse/$edition/modules/$repositoryName/release:$previousChannel | grep -aoE '\{"version":".*"\}' | jq -r .version) | ||
if [[ "$version" == "$previousChannelVersion" ]]; then | ||
echo "Previous channel $previousChannel version $previousChannelVersion is equal desired version $version, processing" | ||
exit 0 | ||
else | ||
echo "Previous channel $previousChannel version $previousChannelVersion is not equal desired version $version, rejecting" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters