-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minor] Add Update and Upgrade command support (#54)
- Loading branch information
Showing
20 changed files
with
781 additions
and
110 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,4 +1,7 @@ | ||
## Changes | ||
|
||
- [`2.3`](https://github.com/ibm-mas/cli/releases/tag/2.3.0) Add Update and Upgrade command support | ||
- [`2.2`](https://github.com/ibm-mas/cli/releases/tag/2.2.0) Catalog update for IoT airgap support fix | ||
- [`2.1`](https://github.com/ibm-mas/cli/releases/tag/2.1.0) Support Maximo Optimizer & Visual Inspection on Air Gap | ||
- [`2.0`](https://github.com/ibm-mas/cli/releases/tag/2.0.0) Support for MAS 8.8 & Maximo Curated Operator Catalog | ||
- [`1.0`](https://github.com/ibm-mas/cli/releases/tag/1.0.0) Initial release |
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
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
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,40 @@ | ||
#!/bin/bash | ||
|
||
# - Set up namespace | ||
# - Create tasks and pipeline resources | ||
# - Set up RBAC | ||
function pipeline_install_tasks() { | ||
# Install the MAS Tekton definitions | ||
cp $DIR/templates/ibm-mas-tekton.yaml $CONFIG_DIR/ibm-mas-tekton-$MAS_INSTANCE_ID.yaml | ||
sed -e "s/:latest/:$VERSION/g" $DIR/templates/deployment.yaml > $CONFIG_DIR/deployment-$MAS_INSTANCE_ID.yaml | ||
CLI_IMAGE=quay.io/ibmmas/cli:$VERSION | ||
|
||
if [[ "$AIRGAP_MODE" == "true" ]]; then | ||
# If we're installing on airgap then we can't reference the images by tag, we need to prompt the user to enter the digest of | ||
# a specific version of the container image ... we can't do this automatically as we are inside the image. | ||
prompt_for_confirm_default_yes "Override image tag '$VERSION' with digest?" USE_DIGEST | ||
if [[ "$USE_DIGEST" == "true" ]]; then | ||
CLI_IMAGE_DIGEST=$(skopeo inspect docker://quay.io/ibmmas/cli:$VERSION 2>> $LOGFILE | jq -r ".Digest") | ||
if [[ "$CLI_IMAGE_DIGEST" == "" ]]; then | ||
echo_warning "Unable to retrieve image digest for quay.io/ibmmas/cli:$VERSION" | ||
exit 1 | ||
fi | ||
echo "Using image digest $CLI_IMAGE_DIGEST" | ||
# Overwrite the tekton definitions with one that uses the looked up image digest | ||
sed -e "s/:$VERSION/@$CLI_IMAGE_DIGEST/g" $DIR/templates/ibm-mas-tekton.yaml > $CONFIG_DIR/ibm-mas-tekton-$MAS_INSTANCE_ID.yaml | ||
sed -e "s/:latest/@$CLI_IMAGE_DIGEST/g" $DIR/templates/deployment.yaml > $CONFIG_DIR/deployment-$MAS_INSTANCE_ID.yaml | ||
CLI_IMAGE=quay.io/ibmmas/cli@$CLI_IMAGE_DIGEST | ||
fi | ||
fi | ||
|
||
# Set up namespace | ||
sed "s/{{mas_instance_id}}/$MAS_INSTANCE_ID/g" $DIR/templates/namespace.yaml > $CONFIG_DIR/namespace-$MAS_INSTANCE_ID.yaml | ||
oc apply -f $CONFIG_DIR/namespace-$MAS_INSTANCE_ID.yaml &>> $LOGFILE | ||
|
||
# Create tasks and pipeline resources in namespace | ||
oc -n mas-$MAS_INSTANCE_ID-pipelines apply -f $CONFIG_DIR/ibm-mas-tekton-$MAS_INSTANCE_ID.yaml &>> $LOGFILE | ||
|
||
# Set up RBAC in namespace | ||
sed "s/{{mas_instance_id}}/$MAS_INSTANCE_ID/g" $DIR/templates/rbac.yaml > $CONFIG_DIR/rbac-$MAS_INSTANCE_ID.yaml | ||
oc apply -f $CONFIG_DIR/rbac-$MAS_INSTANCE_ID.yaml &>> $LOGFILE | ||
} |
Oops, something went wrong.