-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add version checker script with documentation
- Loading branch information
1 parent
89743f5
commit 2e26912
Showing
18 changed files
with
368 additions
and
90 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
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,20 +1,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Deploy KLM from registry" type="ShConfigurationType"> | ||
<option name="SCRIPT_TEXT" value="echo $KLM_IMAGE_REGISTRY; " /> | ||
<option name="SCRIPT_TEXT" value="echo "Enter KLM image registry (dev, prod):"; read input_img_reg; echo "Enter KLM image tag (e.g.: latest):"; read input_img_tag; $PROJECT_DIR$/scripts/tests/deploy_klm_from_registry.sh --image-registry $input_img_reg --image-tag $input_img_tag" /> | ||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" /> | ||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/deploy_klm_from_registry.sh" /> | ||
<option name="SCRIPT_PATH" value="" /> | ||
<option name="SCRIPT_OPTIONS" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" /> | ||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" /> | ||
<option name="INTERPRETER_PATH" value="/bin/bash" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="EXECUTE_IN_TERMINAL" value="true" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="true" /> | ||
<envs> | ||
<env name="IMG_REGISTRY_HOST" value="europe-docker.pkg.dev/kyma-project" /> | ||
<env name="IMG_NAME" value="lifecycle-manager" /> | ||
</envs> | ||
<option name="EXECUTE_SCRIPT_FILE" value="false" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
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,20 +1,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Deploy KLM from sources" type="ShConfigurationType"> | ||
<option name="SCRIPT_TEXT" value="export KUBECONFIG=${HOME}/.k3d/kcp-local.yaml;TAG=\"$(date +%Y%m%d%H%M%S)\" && make docker-build IMG=${LOCAL_IMG}:${TAG}; make docker-push IMG=${LOCAL_IMG}:${TAG}; make local-deploy-with-watcher IMG=${CLUSTER_IMG}:${TAG}" /> | ||
<option name="SCRIPT_TEXT" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" /> | ||
<option name="SCRIPT_PATH" value="" /> | ||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/deploy_klm_from_sources.sh" /> | ||
<option name="SCRIPT_OPTIONS" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" /> | ||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" /> | ||
<option name="INTERPRETER_PATH" value="/bin/zsh" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="EXECUTE_IN_TERMINAL" value="true" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="false" /> | ||
<envs> | ||
<env name="LOCAL_IMG" value="localhost:5111/lifecycle-manager" /> | ||
<env name="CLUSTER_IMG" value="k3d-kcp-registry.localhost:5000/lifecycle-manager"/> | ||
</envs> | ||
<option name="EXECUTE_SCRIPT_FILE" value="true" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Install CRDs" type="ShConfigurationType"> | ||
<option name="SCRIPT_TEXT" value="export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; make install" /> | ||
<option name="SCRIPT_TEXT" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" /> | ||
<option name="SCRIPT_PATH" value="" /> | ||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/install_crds.sh" /> | ||
<option name="SCRIPT_OPTIONS" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" /> | ||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" /> | ||
<option name="INTERPRETER_PATH" value="/bin/zsh" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="EXECUTE_IN_TERMINAL" value="true" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="false" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="true" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
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,16 +1,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Un-Deploy kyma" type="ShConfigurationType"> | ||
<option name="SCRIPT_TEXT" value="export KUBECONFIG=$HOME/.k3d/kcp-local.yaml; kubectl -n kcp-system delete kyma kyma-sample; kubectl -n kcp-system delete secret kyma-sample" /> | ||
<option name="SCRIPT_TEXT" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" /> | ||
<option name="SCRIPT_PATH" value="" /> | ||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/tests/undeploy_kyma.sh" /> | ||
<option name="SCRIPT_OPTIONS" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" /> | ||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" /> | ||
<option name="INTERPRETER_PATH" value="/bin/zsh" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="EXECUTE_IN_TERMINAL" value="true" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="false" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="true" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
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,60 @@ | ||
# Overview of All Scripts | ||
|
||
## Version Checker: `version.sh` | ||
The script checks if the Command Line Tools (CLI) for `kubectl`, `docker`, `GoLang`, `k3d`, and `istioctl` have the correct versions. | ||
It ensures that the versions are in a valid format using [Semantic Versioning](https://semver.org/). | ||
If the check detects outdated versions, it gives a warning and exits with success. For more information, see all the possible exit statuses: | ||
|
||
* `0` - Success - the version is up-to-date or outdated and it uses the correct Semantic Versioning | ||
* `1` - At least one of the CLI tools is not installed | ||
* `2` - Invalid version found, for example, incorrect Semantic Versioning | ||
|
||
### Current Versions | ||
| CLI Tool | Version | | ||
| --------- | ------- | | ||
| `kubectl` | v1.31.3 | | ||
| `go` | v1.23.3 | | ||
| `k3d` | v5.6.0 | | ||
| `docker` | v27.3.1 | | ||
| `istioctl`| v1.24.1 | | ||
|
||
|
||
## Create Test Clusters: `create_test_cluster.sh` | ||
The script creates two test clusters using `k3d`: | ||
- `kcp` for the control plane | ||
- `skr` for the Kyma runtime | ||
If the clusters already exist, the script exits with success. | ||
If you get a notification, while running the script, saying that the Watcher CR is missing, re-run the script. | ||
The script is accompanied by the `Ensure Test Clusters` task in the VSCode tasks, and by the corresponding run configuration for GoLand. | ||
|
||
This script internally depends on `version.sh` to check the versions of the required tools. If you want to skip the version check, use the `--skip-version-check` flag. | ||
|
||
## Cleaning the Clusters: `clusters_cleanup.sh` | ||
The script deletes the `kcp` and `skr` test clusters using `k3d`. | ||
|
||
## Deploying KLM from Sources: `deploy_klm_from_sources.sh` | ||
The script deploys Lifecycle Manager using the current state of the locally cloned and developed repository. | ||
It doesn't require any additional flags or parameters. | ||
|
||
## Deploying KLM from the Registry: `deploy_klm_from_registry.sh` | ||
The script deploys Lifecycle Manager from the given image registry and the given image tag. | ||
It requires the following parameters: | ||
- `--image-registry`: The accepted values are `prod` and `dev`. | ||
- `--image-tag`: The tag of the image to be used. For example, `latest`. | ||
|
||
## Deploy Kyma: `deploy_kyma.sh` | ||
Use the script to deploy Kyma using one of the **required** parameters: | ||
- `localhost`: To run Lifecycle Manager locally on your machine. | ||
- `host.k3d.internal`: To deploy Lifecycle Manager to a cluster. | ||
|
||
## Undeploy Kyma: `undeploy_kyma.sh` | ||
The script undeploys Kyma from the cluster by deleting the Kyma and the corresponding Secret from the `kcp-system` namespace. | ||
|
||
## End-To-End Tests: `e2e.sh` | ||
The script runs end-to-end tests taking the test target as input. | ||
The test targets are defined in the `tests` directory of the project root. | ||
The script runs the test target and outputs the results to the console. | ||
The errors that occurred during the test are handled directly by `make`. | ||
|
||
## Installing CRDs: `install_crds.sh` | ||
The script installs Custom Resource Definitions (CRDs) required for Lifecycle Manager. The CRDs' set is the same as in the `make install` of the Makefile in the project root directory. |
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,6 @@ | ||
#!/bin/bash | ||
|
||
# Remove the k3d cluster and the skr cluster | ||
k3d cluster rm kcp skr | ||
|
||
echo "[$(basename $0)] Cleanup completed" |
Oops, something went wrong.