Skip to content

Commit

Permalink
[minor] Support customizable CLI version in tekton (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
durera authored Dec 25, 2022
1 parent f0ab7de commit c2854e6
Show file tree
Hide file tree
Showing 110 changed files with 1,131 additions and 888 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker run -ti --rm quay.io/ibmmas:local
This is a great way to test in a clean environment (e.g. to ensure the myriad of environment variables that you no doubt have set up are not impacting your test scenarios). After you commit your changes to the repository a pre-release container image will be built, which contains your in-development version of the collection:

```bash
docker run -ti --rm quay.io/ibmmas/cli:x.y.z-pre.mybranch
docker run -ti --rm --pull always quay.io/ibmmas/cli:x.y.z-pre.mybranch
oc login --token=xxxx --server=https://myocpserver
export STUFF
ansible localhost -m include_role -a name=ibm.mas_devops.ocp_verify
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There are minimal dependencies to meet on your own computer to use the CLI:
- OpenShift client
- Network access to the OpenShift cluster

The best way to use the CLI is via the container image: `docker run -ti -v ~:/home/local quay.io/ibmmas/cli`.
The best way to use the CLI is via the container image: `docker run -ti -v ~:/home/local --pull always quay.io/ibmmas/cli`.

The install is designed to work on any OCP cluster, but has been specifically tested in these environments:
- IBMCloud ROKS
Expand Down
2 changes: 1 addition & 1 deletion build/bin/build-tekton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for FILE in $PIPELINE_FILES; do
cat $FILE >> $TARGET_FILE
done

sed "s/:latest/:$VERSION/g" $TARGET_FILE > $TARGET_FILE.txt
sed "s/default: latest/default: \"$VERSION\"/g" $TARGET_FILE > $TARGET_FILE.txt

rm $TARGET_FILE
mv $TARGET_FILE.txt $TARGET_FILE
Expand Down
3 changes: 3 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changes

- [`3.5`](https://github.com/ibm-mas/cli/releases/tag/3.5.0) Add fvt-core test pipeline
- [`3.4`](https://github.com/ibm-mas/cli/releases/tag/3.4.0) Add support for the FVT enhanced pipeline
- [`3.3`](https://github.com/ibm-mas/cli/releases/tag/3.3.0) Add support for single node OpenShfit on AWS
- [`3.2`](https://github.com/ibm-mas/cli/releases/tag/3.2.0) Add support for Nov 2022 catalog
- [`3.1`](https://github.com/ibm-mas/cli/releases/tag/3.1.0) Support two-phase RH image mirroring
- [`3.0`](https://github.com/ibm-mas/cli/releases/tag/3.0.0) Support combined mas_devops and mas_airgap Ansible collection
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/configure-airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

### Interactive
```bash
docker run -ti --rm -v ~:/mnt/local quay.io/ibmmas/cli mas configure-airgap
docker run -ti --rm -v ~:/mnt/local --pull always quay.io/ibmmas/cli mas configure-airgap
```

### Non-Interactive
```bash
docker run -ti --rm -v ~:/mnt/local quay.io/ibmmas/cli mas configure-airgap \
docker run -ti --rm -v ~:/mnt/local --pull always quay.io/ibmmas/cli mas configure-airgap \
-H myprivateregistry.com -P 5000 -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD \
--ca-file /mnt/local/registry-ca.crt \
--no-confirm
Expand Down
3 changes: 1 addition & 2 deletions docs/commands/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ The install is an interactive command. At present there is no support for an
unattended install, but this is planned for the future.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm -v ~:/home/local quay.io/ibmmas/cli
docker run -ti --rm -v ~:/home/local --pull always quay.io/ibmmas/cli
mas install
```

Expand Down
8 changes: 3 additions & 5 deletions docs/commands/mirror-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ Examples
-------------------------------------------------------------------------------
### Interactive Image Mirroring
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm -v /mnt/registry:/mnt/registry quay.io/ibmmas/cli mas mirror-images
docker run -ti --rm -v /mnt/registry:/mnt/registry --pull always quay.io/ibmmas/cli mas mirror-images
```

### Two-Phase Image Mirroring
Expand All @@ -75,7 +74,7 @@ First, download the latest version of the container image and start up a termina

```bash
docker pull quay.io/ibmmas/cli:3.3.0
docker run -ti --rm -v /mnt/registry:/mnt/registry quay.io/ibmmas/cli mas mirror-images \
docker run -ti --rm -v /mnt/registry:/mnt/registry quay.io/ibmmas/cli:3.3.0 mas mirror-images \
--mode to-filesystem \
--dir /mnt/registry \
--ibm-entitlement $IBM_ENTITLEMENT_KEY \
Expand Down Expand Up @@ -125,8 +124,7 @@ docker run -ti --rm -v /mnt/mirrorregistry:/mnt/mirrorregistry mirror.mydomain.c
The following example will mirror all images required for Maximo Application Suite Core and the Maximo Manage and IoT applications directly to your target registry, without prompting for confirmation.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas mirror-images \
docker run -ti --rm --pull always quay.io/ibmmas/cli mas mirror-images \
--mode direct \
--dir /mnt/registry \
--ibm-entitlement $IBM_ENTITLEMENT_KEY \
Expand Down
3 changes: 1 addition & 2 deletions docs/commands/provision-aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Usage
### Non-Interactive Mode

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-aws
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-aws
```
6 changes: 2 additions & 4 deletions docs/commands/provision-fyre.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ Examples
-------------------------------------------------------------------------------
### Interactive Mode
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-fyre
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-fyre
```

### Non-Interactive Mode
```bash
export FYRE_USERNAME=xxx
export FYRE_APIKEY=xxx
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-fyre \
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-fyre \
-u $FYRE_USERNAME -a $FYRE_APIKEY \
-p 225 -q product_group \
-c masonfyre -d "My Cluster" -v 4.10 \
Expand Down
6 changes: 2 additions & 4 deletions docs/commands/provision-roks.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ Examples

### Interactive Mode
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-roks
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-roks
```

### Non-Interactive Mode
```bash
export IBMCLOUD_APIKEY=xxx
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-roks \
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-roks \
-a $IBMCLOUD_APIKEY -r mas-development \
-c masonroks -v 4.10_openshift \
--worker-count 3 --worker-flavor b3c.16x64.300gb --worker-zone dal10 \
Expand Down
3 changes: 1 addition & 2 deletions docs/commands/provision-rosa.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ Usage
### Non-Interactive Mode

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas provision-rosa
docker run -ti --rm --pull always quay.io/ibmmas/cli mas provision-rosa
```
2 changes: 1 addition & 1 deletion docs/commands/setup-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Usage
-------------------------------------------------------------------------------

```bash
docker run -ti --rm quay.io/ibmmas/cli mas setup-registry
docker run -ti --rm --pull always quay.io/ibmmas/cli mas setup-registry
```
6 changes: 2 additions & 4 deletions docs/commands/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ Examples
-------------------------------------------------------------------------------
### Interactive Update
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas update
docker run -ti --rm --pull always quay.io/ibmmas/cli mas update
```

### Non-Interactive Update
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas update -c v8-220927-amd64 --no-confirm
docker run -ti --rm --pull always quay.io/ibmmas/cli mas update -c v8-220927-amd64 --no-confirm
```
6 changes: 2 additions & 4 deletions docs/commands/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ Examples
-------------------------------------------------------------------------------
### Interactive Upgrade
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas upgrade
docker run -ti --rm --pull always quay.io/ibmmas/cli mas upgrade
```

### Non-Interactive Upgrade
```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas upgrade -i inst1 --no-confirm
docker run -ti --rm --pull always quay.io/ibmmas/cli mas upgrade -i inst1 --no-confirm
```
12 changes: 4 additions & 8 deletions docs/guides/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ Disconnected install for IBM Maximo Application Suite is supported from MAS v8.8
If you do not already have a private registry available to use as your mirror then you can use the `setup-mirror` function to deploy a private registry inside a target OpenShift cluster.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti quay.io/ibmmas/cli mas setup-registry
docker run -ti --rm --pull always quay.io/ibmmas/cli mas setup-registry
```

The registry will be setup running on port 32500. For more details on this step, refer to the [setup-registry](../commands/setup-registry.md) command's documentation. Regardless of whether you set up a new registry or already had one, you need to collect the following information about your private registry:
Expand All @@ -101,8 +100,7 @@ Mirroring the images is a simple but time consuming process, this step must be p
- **from-filesystem** mirrors images from a local directory to your private registry

```bash
docker pull quay.io/ibmmas/cli
docker run -ti quay.io/ibmmas/cli mas mirror-images
docker run -ti --pull always quay.io/ibmmas/cli mas mirror-images
```

You will be prompted to set the target registry for the image mirroring and to [select the version of IBM Maximo Operator Catalog to mirror](choosing-the-right-catalog.md) and the subset of content that you wish to mirror. You can choose to mirror everything from the catalog, or control exactly what is mirrored to your private registry to reduce the time and bandwidth used to mirror the images, as well reducing the storage requirements of the registry.
Expand All @@ -124,8 +122,7 @@ mas mirror-images \
Your cluster must be configured to use the private registry as a mirror for the MAS container images. An `ImageContentSourcePolicy` named `mas-and-dependencies` will be created in the cluster, this is also the resource that the MAS install will use to detect whether the installation is a disconnected install and tailor the options presented when you run the `mas install` command.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti quay.io/ibmmas/cli mas configure-airgap
docker run -ti --pull always quay.io/ibmmas/cli mas configure-airgap
```

You will be prompted to provide information about the private registry, including the CA certificate necessary to configure your cluster to trust the private registry.
Expand All @@ -145,6 +142,5 @@ mas configure-airgap \
Regardless of whether you are running a connected or disconnect installation, simply run the `mas install` command and follow the prompts.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti quay.io/ibmmas/cli mas install
docker run -ti --pull always quay.io/ibmmas/cli mas install
```
6 changes: 2 additions & 4 deletions docs/guides/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ Before you start the update, you must mirror the images for the new catalog that
- **from-filesystem** mirrors images from a local directory to your private registry

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas mirror-images
docker run -ti --rm --pull always quay.io/ibmmas/cli mas mirror-images
```

You will be prompted to set the target registry for the image mirroring and to [select the version of IBM Maximo Operator Catalog to mirror](choosing-the-right-catalog.md) and the subset of content that you wish to mirror. You can choose to mirror everything from the catalog, or control exactly what is mirrored to your private registry to reduce the time and bandwidth used to mirror the images, as well reducing the storage requirements of the registry.
Expand Down Expand Up @@ -49,8 +48,7 @@ Run `mas update` and choose the catalog to update to. This will update the oper
You must select a newer catalog than what is already in use. Updating to an older static catalog is not supported.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas update
docker run -ti --rm --pull always quay.io/ibmmas/cli mas update
```


Expand Down
6 changes: 2 additions & 4 deletions docs/guides/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Before you start the upgrade, you must mirror the images for the new catalog tha
- **from-filesystem** mirrors images from a local directory to your private registry

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas mirror-images
docker run -ti --rm --pull always quay.io/ibmmas/cli mas mirror-images
```

You will be prompted to set the target registry for the image mirroring and to [select the version of IBM Maximo Operator Catalog to mirror](choosing-the-right-catalog.md) and the subset of content that you wish to mirror. You can choose to mirror everything from the catalog, or control exactly what is mirrored to your private registry to reduce the time and bandwidth used to mirror the images, as well reducing the storage requirements of the registry.
Expand All @@ -55,8 +54,7 @@ mas mirror-images \
Run `mas upgrade` and choose the MAS instance to upgrade. The upgrade will automatically detect the installed release, and perform an upgrade to the next available release.

```bash
docker pull quay.io/ibmmas/cli
docker run -ti --rm quay.io/ibmmas/cli mas upgrade
docker run -ti --rm --pull always quay.io/ibmmas/cli mas upgrade
```

The command can also be ran non-interactive.
Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Installation
The best way to use the CLI is to not install it at all and use the container image we publish:

```bash
docker pull quay.io/ibmmas/cli
docker run -ti -v ~:/home/local quay.io/ibmmas/cli
docker run -ti -v ~:/home/local --pull always quay.io/ibmmas/cli
```

!!! tip
Expand Down
2 changes: 1 addition & 1 deletion image/cli/install/install-aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
unzip -q awscliv2.zip
./aws/install

rm -rf aws
Expand Down
2 changes: 1 addition & 1 deletion image/cli/install/install-ibmcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

wget -q https://download.clis.cloud.ibm.com/ibm-cloud-cli/2.12.1/IBM_Cloud_CLI_2.12.1_amd64.tar.gz
tar -xvzf IBM_Cloud_CLI_2.12.1_amd64.tar.gz
tar -xzf IBM_Cloud_CLI_2.12.1_amd64.tar.gz
mv Bluemix_CLI/bin/ibmcloud /usr/local/bin/
rm -rf Bluemix_CLI IBM_Cloud_CLI_2.3.0_amd64.tar.gz
ibmcloud plugin repo-plugins -r 'IBM Cloud'
Expand Down
2 changes: 1 addition & 1 deletion image/cli/install/install-ibmpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

curl -L https://github.com/IBM/ibm-pak-plugin/releases/download/v1.3.1/oc-ibm_pak-linux-amd64.tar.gz -o oc-ibm_pak-linux-amd64.tar.gz
tar -xvf oc-ibm_pak-linux-amd64.tar.gz
tar -xf oc-ibm_pak-linux-amd64.tar.gz
mv oc-ibm_pak-linux-amd64 /usr/local/bin/oc-ibm_pak
rm oc-ibm_pak-linux-amd64.tar.gz

Expand Down
2 changes: 1 addition & 1 deletion image/cli/install/install-skopeo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -e
dnf install skopeo hostname httpd-tools -y
dnf clean all
wget -q https://github.com/IBM/cloud-pak-cli/releases/download/v3.17.0/cloudctl-linux-amd64.tar.gz
tar -xvf cloudctl-linux-amd64.tar.gz
tar -xf cloudctl-linux-amd64.tar.gz
mv cloudctl-linux-amd64 /usr/bin/cloudctl
rm cloudctl-linux-amd64.tar.gz
4 changes: 0 additions & 4 deletions image/cli/mascli/functions/pipeline_config
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,13 @@ function pipeline_config() {
echo_h2 "7c. Configure IBM Container Registry (MAS)"
prompt_for_input "IBM Container Registry (cp)" MAS_ICR_CP wiotp-docker-local.artifactory.swg-devops.com override
prompt_for_input "IBM Container Registry (cpopen)" MAS_ICR_CPOPEN wiotp-docker-local.artifactory.swg-devops.com/cpopen override
# prompt_for_input "Entitlement Username" MAS_ENTITLEMENT_USERNAME $ARTIFACTORY_USERNAME override
# prompt_for_input "Entitlement Key" MAS_ENTITLEMENT_KEY $ARTIFACTORY_APIKEY override
MAS_ENTITLEMENT_USERNAME=cp
MAS_ENTITLEMENT_KEY=$IBM_ENTITLEMENT_KEY

echo
echo_h2 "7d. Configure IBM Container Registry (SLS)"
prompt_for_input "IBM Container Registry (cp)" SLS_ICR_CP wiotp-docker-local.artifactory.swg-devops.com override
prompt_for_input "IBM Container Registry (cpopen)" SLS_ICR_CPOPEN wiotp-docker-local.artifactory.swg-devops.com/cpopen override
# prompt_for_input "Entitlement Username" SLS_ENTITLEMENT_USERNAME $ARTIFACTORY_USERNAME override
# prompt_for_input "Entitlement Key" SLS_ENTITLEMENT_KEY $ARTIFACTORY_APIKEY override
SLS_ENTITLEMENT_USERNAME=cp
SLS_ENTITLEMENT_KEY=$IBM_ENTITLEMENT_KEY
else
Expand Down
9 changes: 5 additions & 4 deletions image/cli/mascli/functions/pipeline_config_applications
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function config_pipeline_applications() {
if prompt_for_confirm "Install IoT"; then
channel_select_iot || exit 1
fi

# Applications only supported in online installs
if [[ -z "$AIRGAP_MODE" ]]; then
# Applications that require IoT
Expand All @@ -195,6 +195,7 @@ function config_pipeline_applications() {
# Manage
if prompt_for_confirm "Install Manage"; then
channel_select_manage || exit 1
prompt_for_confirm_default_yes "+ Create demo data" MAS_APP_SETTINGS_DEMODATA
fi

if [[ "$SNO_MODE" != "true" ]]; then
Expand All @@ -204,17 +205,17 @@ function config_pipeline_applications() {
channel_select_optimizer || exit 1
# Optimizer install Plan + Validation
while : ; do
prompt_for_input 'Optimizer Install Plan [full/limited]' MAS_APP_PLAN_OPTIMIZER "full"
prompt_for_input '+ Plan [full/limited]' MAS_APP_PLAN_OPTIMIZER "full"
[[ "$MAS_APP_PLAN_OPTIMIZER" != "full" && "$MAS_APP_PLAN_OPTIMIZER" != "limited" ]] || break
done
fi
fi

# Maximo Visual Inspection
if prompt_for_confirm "Install Visual Inspection"; then
channel_select_visualinspection || exit 1
fi

# Applications only supported in online installs
if [[ -z "$AIRGAP_MODE" ]]; then
# Applications that require Manage
Expand Down
8 changes: 1 addition & 7 deletions image/cli/mascli/functions/pipeline_config_sno
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function config_pipeline_sno() {
echo ""
if [[ "$SNO_MODE" == "true" ]]; then
# SNO Mode -- Set environment variables MONGODB_REPLICAS=1
echo_h2 "Info: SNO_MODE was detected."
echo_highlight "Single Node OpenShift detected"
export MONGODB_REPLICAS=1
export MONGODB_CPU_REQUESTS=500m
export MAS_APP_SETTINGS_AIO_FLAG=false
Expand All @@ -16,11 +16,5 @@ function config_pipeline_sno() {
export DB2_BACKUP_STORAGE_ACCESSMODE=ReadWriteOnce
export DB2_DATA_STORAGE_ACCESSMODE=ReadWriteOnce
export DB2_LOGS_STORAGE_ACCESSMODE=ReadWriteOnce
#export DB2_NAMESPACE=db2u

prompt_for_confirm_default_yes "Do you want manage demodata to be loaded or not " MAS_APP_SETTINGS_DEMODATA && export MAS_APP_SETTINGS_DEMODATA
else
echo_h2 "Info: SNO_MODE was not detected"
fi
}

3 changes: 1 addition & 2 deletions image/cli/mascli/functions/pipeline_config_storage_classes
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ function config_pipeline_storage_classes() {
echo "${TEXT_DIM} - Storage class (ReadWriteMany): efs"
STORAGE_CLASS_PROVIDER=aws
STORAGE_CLASS_RWO=gp2
STORAGE_CLASS_RWX=efs
STORAGE_CLASS_RWX=efs
fi
fi
reset_colors

echo "${TEXT_DIM} - SNO MODE is set to ${SNO_MODE}"
PIPELINE_STORAGE_CLASS=$STORAGE_CLASS_RWX
PIPELINE_STORAGE_ACCESSMODE="ReadWriteMany"
if [[ "$SNO_MODE" == "true" ]]; then
Expand Down
Loading

0 comments on commit c2854e6

Please sign in to comment.