Skip to content

Commit

Permalink
Merge branch 'master' into mascore3901
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayprab committed Sep 27, 2024
2 parents 7b43c65 + 14a223a commit d3768e2
Show file tree
Hide file tree
Showing 30 changed files with 876 additions and 522 deletions.
2 changes: 1 addition & 1 deletion build/bin/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Update all the placeholders in the doc source
# Make sure not to commit these changes if you run this script locally
find docs -type f -name '*.md' -exec sed -i \
-e 's/@@CLI_LATEST_VERSION@@/10.9.2/g' \
-e 's/@@CLI_LATEST_VERSION@@/11.1.3/g' \
-e 's/@@MAS_PREVIOUS_CHANNEL@@/8.11.x/g' \
-e 's/@@MAS_PREVIOUS_CATALOG@@/v8-240730-amd64/g' \
-e 's/@@MAS_LATEST_CHANNEL@@/9.0.x/g' \
Expand Down
6 changes: 6 additions & 0 deletions build/bin/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ echo "RELEASE_LABEL .. $GITHUB_RUN_ID"
echo "VCS_REF ........ $GITHUB_SHA"
echo "VCS_URL ........ https://github.com/$GITHUB_REPOSITORY"

# Remove expires-after for release builds (only pre-release builds should auto-expire)
if [[ ! "$DOCKER_TAG" == *"-pre."* ]]; then
echo "Removing quay.expires-after label from Dockerfile"
sed -i "/quay.expires-after/d" $DOCKERFILE
fi

docker build \
--build-arg VERSION_LABEL=$DOCKER_TAG \
--build-arg RELEASE_LABEL=$GITHUB_RUN_ID \
Expand Down
2 changes: 1 addition & 1 deletion docs/catalogs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To receive security updates and bug fixes you must periodically update the versi
| [v9-240827-amd64](v9-240827-amd64.md) | 4.12 - 4.15 | latest | OCP 4.14 EOS October 31, 2025 |
| [v9-240730-amd64](v9-240730-amd64.md) | 4.12 - 4.15 | latest | OCP 4.14 EOS October 31, 2025 |
| [v9-240625-amd64](v9-240625-amd64.md) | 4.12 - 4.14 | latest | OCP 4.14 EOS October 31, 2025 |
| [v8-240528-amd64](v8-240528-amd64.md) | 4.12 - 4.14 | 10.8.0 | OCP 4.14 EOS October 31, 2025 |
| [v8-240528-amd64](v8-240528-amd64.md) | 4.12 - 4.14 | 10.8.1 | OCP 4.14 EOS October 31, 2025 |
| [v8-240430-amd64](v8-240430-amd64.md) | 4.12 - 4.14 | 9.4.0 | OCP 4.14 EOS October 31, 2025 |
| [v8-240405-amd64](v8-240405-amd64.md) | 4.12 - 4.14 | 9.4.0 | OCP 4.14 EOS October 31, 2025 |
| [v8-240326-amd64](v8-240326-amd64.md) | 4.12 - 4.14 | 9.4.0 | OCP 4.14 EOS October 31, 2025 |
Expand Down
61 changes: 43 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
IBM Maximo Application Suite CLI Utility
===============================================================================
There are various dependencies to meet on your own computer to use the CLI, depending on which functions you are using:
The CLI comes in two flavours; **container image** and **standalone binary**.

The standalone CLI is available for three platforms, and available from the downloads page on each [GitHub release](https://github.com/ibm-mas/cli/releases/tag/@@CLI_LATEST_VERSION@@), however it does not currently support everything supported by the container image:

| CLI Function | Image | Binary |
| -------------------------------------------------------- | :------: | :------: |
| [install](commands/install.md) | ✓ | ✓ |
| [update](commands/update.md) | ✓ | ✓ |
| [upgrade](commands/upgrade.md) | ✓ | ✓ |
| [uninstall](commands/uninstall.md) | ✓ | ✓ |
| [must-gather](commands/must-gather.md) | ✓ | ✕ |
| [configure-airgap](commands/configure-airgap.md) | ✓ | ✕ |
| [mirror-images](commands/mirror-images.md) | ✓ | ✕ |
| [mirror-redhat-images](commands/mirror-redhat-images.md) | ✓ | ✕ |
| [setup-registry](commands/setup-registry.md) | ✓ | ✕ |
| [teardown-registry](commands/teardown-registry.md) | ✓ | ✕ |
| [provision-fyre](commands/provision-fyre.md) | ✓ | ✕ |
| [provision-roks](commands/provision-roks.md) | ✓ | ✕ |
| [provision-rosa](commands/provision-rosa.md) | ✓ | ✕ |
| [configtool-oidc](commands/configtool-oidc.md) | ✓ | ✕ |


Container Image
-------------------------------------------------------------------------------
The best way to use the MAS CLI is to use the container image we publish to quay.io:

- Bash (v4)
- OpenShift client
- IBMCloud client with container plugin enabled
- Ansible
- Python
- Network access to the OpenShift cluster
```bash
docker run -ti --rm -v ~:/mnt/home --pull always quay.io/ibmmas/cli mas install --help
```

!!! tip
If you want to stick with a specific release of the image you can attach a version tag to the docker run command: `docker run -ti --rm -v ~:/mnt/home quay.io/ibmmas/cli:@@CLI_LATEST_VERSION@@`

Installation
-------------------------------------------------------------------------------
The best way to use the CLI is to not install it at all and use the container image we publish:
The container image provides an out of the box environment for managing MAS on OpenShift, with numerous dependencies pre-installed (see [cli-base](https://github.com/ibm-mas/cli-base) for details). The Maximo Application Suite Ansible Collection is included in these dependencies, so even if you prefer to drive Ansible directy the CLI image can be a useful tool:

```bash
docker run -ti --rm -v ~:/mnt/home --pull always quay.io/ibmmas/cli
docker run -ti --rm -v ~:/mnt/home --pull always quay.io/ibmmas/cli ansible-playbook ibm.mas_devops.oneclick_core
```

!!! tip
Running `docker pull` before `docker run` will ensure you are using the latest release of the container image.

If you want to stick with a specific release of the image you can attach a specific version tag to the docker run command: `docker run -ti --rm -v ~:/mnt/home quay.io/ibmmas/cli:x.y.z`
Standalone Binary
-------------------------------------------------------------------------------
Introduced in Summer 2024, the standalone binary is a new way to use the MAS CLI, you can download version @@CLI_LATEST_VERSION@@ of the CLI for following platforms using the links below:

- [Windows (amd64)](https://github.com/ibm-mas/cli/releases/download/@@CLI_LATEST_VERSION@@/mas-cli-windows-amd64)
- [Linux (amd64)](https://github.com/ibm-mas/cli/releases/download/@@CLI_LATEST_VERSION@@/mas-cli-linux-amd64)
- [MacOS (arm64)](https://github.com/ibm-mas/cli/releases/download/@@CLI_LATEST_VERSION@@/mas-cli-macos-arm64)

If you prefer to install the client it can be obtained from the [GitHub releases page](https://github.com/ibm-mas/cli/releases).
For example, to install the CLI and launch a MAS install on Linux:

```bash
wget https://github.com/ibm-mas/cli/releases/download/7.0.0/ibm-mas-cli-7.0.0.tgz
tar -xvf ibm-mas-cli-7.0.0.tgz
./mas mirror-images
wget https://github.com/ibm-mas/cli/releases/download/@@CLI_LATEST_VERSION@@/mas-cli-linux-amd64
cp mas-cli-linux-amd64 /usr/local/bin/mas-cli
mas-cli install --help
```
21 changes: 21 additions & 0 deletions image/cli/app-root/src/finalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
from openshift.dynamic import DynamicClient
from slackclient import SlackClient
from subprocess import PIPE, Popen, TimeoutExpired
from mobilever import MobVer
import threading
from jira import JIRA


class RunCmdResult(object):
def __init__(self, returnCode, output, error):
self.rc = returnCode
Expand Down Expand Up @@ -371,6 +373,25 @@ def getcp4dCompsVersions():
print(f"Unable to determine Manage installed components: status.components unavailable")
except Exception as e:
print(f"Unable to determine Manage installed components: {e}")

# Get Mobile Components
# -------------------------------------------------------------------------
# Note: Only works for workspace "masdev"
try:
#getting versions from mobile
mobileVer = MobVer(instanceId=instanceId, dynClient=dynClient)
mobileComponents = mobileVer.get_graphite_versions()
treatedComponents={}
for key,value in mobileComponents.items():
if "mobileVersion" in value:
treatedComponents[key]={"enabled":True,"version":(value["mobileVersion"]+" || "+value["buildToolsVersion"])}

setObject[f"products.ibm-mas-mobile.buildId"] = "NA"
setObject[f"products.ibm-mas-mobile.buildNumber"] = "NA"
setObject[f"products.ibm-mas-mobile.version"] = mobileComponents["navigator"]["mobileVersion"]
setObject[f"products.ibm-mas-mobile.components"] = treatedComponents
except Exception as e:
print(f"Unable to determine Mobile installed components: {e}")

# Get Maximo Process Automation Engine (MPAE) version
# -------------------------------------------------------------------------
Expand Down
44 changes: 44 additions & 0 deletions image/cli/app-root/src/junit-xml-generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# *****************************************************************************
# Copyright (c) 2024 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# *****************************************************************************
import argparse
import os
from junit_xml import TestSuite, TestCase

#
# The test-cases is a command seperated list of testcasename:timetaken
# Execute:
# `python junit-xml-generator.py --test-suite-name testsuite1 --test-cases operator-catalog:54,secret-update:9 --output-dir .`
#
#
if __name__ == "__main__":
# Initialize the properties we need
parser = argparse.ArgumentParser()

# Primary Options
parser.add_argument("--test-suite-name", required=True)
parser.add_argument("--test-cases", required=True)
parser.add_argument("--output-dir", required=True)

args, unknown = parser.parse_known_args()

test_cases_dict = []
test_case_list = args.test_cases.split(',')
for test_case in test_case_list:
test_case_name = test_case.split(':')[0]
test_case_time = int(test_case.split(':')[1])
print(f"Adding test_case: {test_case_name} with elapsed time {test_case_time}")
test_cases_dict.append(TestCase(test_case_name, test_case_name, test_case_time))

print(f"Creating testsuite : {args.test_suite_name}")
ts = TestSuite(args.test_suite_name, test_cases_dict)

with open(os.path.join(args.output_dir, 'output.xml'), 'w') as f:
TestSuite.to_file(f, [ts], prettyprint=False)
Loading

0 comments on commit d3768e2

Please sign in to comment.