This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from kyleschlosser/release_scripts
Update the prepare release scripts
- Loading branch information
Showing
1 changed file
with
5 additions
and
30 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 |
---|---|---|
@@ -1,34 +1,9 @@ | ||
#!/bin/bash | ||
BASEPATH=$(dirname $(dirname $0)) | ||
DEST=$BASEPATH/deploy/kabanero-operators.yaml | ||
|
||
# Find we are running on MAC. | ||
MAC_EXEC=false | ||
macos=Darwin | ||
if [ "$(uname)" == "Darwin" ]; then | ||
MAC_EXEC=true | ||
fi | ||
# Split the IMAGE variable into repository and tag parts | ||
# e.g. kabanero/kabanero-operator:0.1.1 -> kabanero/kabanero-operator | ||
IFS=’:’ read -ra REPOSITORY <<< "$IMAGE" | ||
|
||
# Prepare operator deployment file | ||
cat << EOF >> $DEST | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: kabanero | ||
--- | ||
EOF | ||
|
||
cat $BASEPATH/deploy/dependencies.yaml >> $DEST; echo "---" >> $DEST | ||
cat $BASEPATH/deploy/operator.yaml >> $DEST; echo "---" >> $DEST | ||
cat $BASEPATH/deploy/role.yaml >> $DEST; echo "---" >> $DEST | ||
cat $BASEPATH/deploy/role_binding.yaml >> $DEST; echo "---" >> $DEST | ||
cat $BASEPATH/deploy/service_account.yaml >> $DEST; echo "---" >> $DEST | ||
|
||
# Update the operator deployment image entry if TRAVIS_TAG is set | ||
if [ ! -z "$TRAVIS_TAG" ]; then | ||
if [[ $MAC_EXEC == true ]]; then | ||
sed -i '' -e "s!image: kabanero-operator:latest!image: kabanero-operator:$TRAVIS_TAG!g" $DEST | ||
else | ||
sed -i "s!image: kabanero-operator:latest!image: kabanero-operator:$TRAVIS_TAG!g" $DEST | ||
fi | ||
fi | ||
# Levearge the gen_operator_deployment.sh script to generate deploy/kabanero-operators.yaml | ||
$BASEPATH/contrib/gen_operator_deployment.sh $REPOSITORY:$TRAVIS_TAG |