This script automates the setup and configuration of various tools and services, primarily for the deployment of the edge-anomaly-detection
application. It ensures the necessary dependencies are installed, repositories are cloned, and configurations are applied.
- OpenShift CLI (
oc
) - Bash shell
- Internet access
The script sets a default repository name if not provided. This can be overridden by setting the REPO_NAME
environment variable.
#REPO_NAME=${REPO_NAME:-tosin2013/external-secrets-manager}
This function waits for a specific OpenShift pod to be in the "Ready" state.
function wait-for-me(){
...
}
The script checks if the ~/.vault_password
file exists and has content. If not, it downloads and runs the ansible_vault_setup.sh
script to configure the Ansible Vault password.
If the configure-aws-cli.sh
script is not found in the home directory, the user is prompted for AWS credentials. The script then downloads and runs the AWS CLI configuration script and creates an S3 bucket.
The script ensures that Git, yq
, and Helm are installed on the system.
The script checks if the edge-anomaly-detection
and external-secrets-manager
repositories are already cloned. If they are, it updates them; otherwise, it clones them.
The script ensures that necessary system packages like podman
, ansible-navigator
, and OpenShift CLI tools are installed.
The script checks the status of ArgoCD and Hashicorp Vault. If they are not available or running, it performs the necessary setup and configuration.
The script checks the status of the MultiClusterHub. If it's not running, it creates the necessary resources.
The script configures the edge-anomaly-detection
application, updates its configuration files, and ensures the necessary pods are running.
- Understand the Flow: Before making changes, understand the flow and purpose of the script.
- Test Changes Locally: Always test your changes locally before submitting a pull request.
- Comment Your Code: Add comments to any new functions or logic you introduce for clarity.
- Maintain Idempotency: Ensure that running the script multiple times won't produce different results or errors.
- Error Handling: Add error handling for any new external commands or logic you introduce.
- Documentation: Update this documentation if you introduce new features or significant changes to the script's flow.