diff --git a/README.md b/README.md index f8ca9ff..77a652e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ## Getting Started -Use the provided execution script simplifies setup, execution and managing DevOps Toolkit. +The provided execution script simplifies the setup, execution, and management of the DevOps Toolkit. ### 1. Install @@ -36,11 +36,14 @@ sudo mv devops-toolkit-cli /usr/local/bin/ ### 2. Run +Navigate to your workspace folder, then: + - Initialize the docker image, container and configuration directory: ```bash devops-toolkit-cli init -# Run 'devops-toolkit-cli init vX.Y.Z' if you want to use specific version. E.g: devops-toolkit-cli init 1.0.2 +# Run 'devops-toolkit-cli init vX.Y.Z' if you want to use specific version. +# E.g: devops-toolkit-cli init 1.0.2 ``` - Start a shell in new container: @@ -61,11 +64,14 @@ devops-toolkit-cli run ls -la devops-toolkit-cli shell ``` -- For more commands, use `devops-toolkit-cli help`. +### 3. Get Help + +- For more commands, run `devops-toolkit-cli help`. +- For detailed `devops-toolkit-cli` document and advanced usage, see: [docs/usage/devops_toolkit_cli](./docs/usage/devops_toolkit_cli.md) -## Use DevOps Toolkit with docker command directly +## Use DevOps Toolkit with Docker Command Directly -Follow this instruction if you would like to use from docker command without the help of the execution script +Follow these instructions if you prefer to use Docker commands without the help of the execution script. ### 1. Quick Start @@ -90,6 +96,7 @@ docker run -it --name devops-toolkit-ctn \ ### 3. Note +- `.dtc` stands for **D**evOps **T**oolkit **C**onfiguration - You can replace `$HOME/.dtc` with any desired folder path on your VM. - Remove the `-v $HOME/.dtc:/dtc` option if you do not wish to store configurations on the host (not recommended for configuration reuse). @@ -107,7 +114,7 @@ docker pull tungbq/devops-toolkit:1.2.3 docker pull tungbq/devops-toolkit:latest ``` -For more details on versioning, check the [release notes](https://github.com/tungbq/devops-toolkit/releases). +For more details on versioning, check the [**release notes**](https://github.com/tungbq/devops-toolkit/releases). ## User Guide 📖 diff --git a/docs/usage/ansible_usage.md b/docs/usage/ansible_usage.md index 460123f..dc8b52a 100644 --- a/docs/usage/ansible_usage.md +++ b/docs/usage/ansible_usage.md @@ -7,7 +7,25 @@ Some document to help you start with ansible - - -## Note +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the ansible command normally +ansible --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container. + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -15,11 +33,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Run Ansible sample code provided in the container +### Use case 1: Run Ansible sample code provided in the container ```bash docker run --rm --network host -v ~/.dtc:/dtc -it tungbq/devops-toolkit:latest @@ -28,7 +46,7 @@ docker run --rm --network host -v ~/.dtc:/dtc -it tungbq/devops-toolkit:latest ansible-playbook samples/ansible/check_os.yml ``` -## Use case 2: Clone external code inside container +### Use case 2: Clone external code inside container ```bash docker run --rm --network host -v ~/.dtc:/dtc -it tungbq/devops-toolkit:latest @@ -43,7 +61,7 @@ cd ansible-examples ansible-playbook ``` -## Use case 3: Mount external code to container +### Use case 3: Mount external code to container Clone the code to the host then mount to container @@ -53,7 +71,7 @@ docker run --rm -v "$(pwd)":/root/ansible_workspace --network host -v ~/.dtc:/dt # Run the ansible code as usual ``` -## Use case 4: Mount external code to container and use .ssh keys from the host +### Use case 4: Mount external code to container and use .ssh keys from the host Clone the code to the host then mount code and `.ssh` folder to container @@ -63,6 +81,6 @@ docker run --rm -v ~/.ssh:/root/.ssh -v "$(pwd)":/root/ansible_workspace --netwo # Run the ansible code as usual ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/awscli_usage.md b/docs/usage/awscli_usage.md index 2408b7d..0b34214 100644 --- a/docs/usage/awscli_usage.md +++ b/docs/usage/awscli_usage.md @@ -11,7 +11,26 @@ Some document to help you start with awscli - - -## Note + +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the awscli command normally +awscli --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container. + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -19,11 +38,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Configure credentials and list S3 bucket with awscli +### Use case 1: Configure credentials and list S3 bucket with awscli ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -46,6 +65,6 @@ Default region name [None]: xxxxxxxx Default output format [None]: xxxxxxxx ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/azurecli_usage.md b/docs/usage/azurecli_usage.md index e9c6658..487c377 100644 --- a/docs/usage/azurecli_usage.md +++ b/docs/usage/azurecli_usage.md @@ -10,7 +10,25 @@ Some document to help you start with azurecli - -## Note +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the az command normally +az --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container. + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -18,18 +36,18 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Az login and run command +### Use case 1: Az login and run command ```bash docker run --rm -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest # Login with AZ CLI az login --use-device-code -## To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code to authenticate +### To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code to authenticate # List all resource groups az group list @@ -55,6 +73,6 @@ root@f097467db632:~# az group list ] ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/devops_toolkit_cli.md b/docs/usage/devops_toolkit_cli.md new file mode 100644 index 0000000..be4e837 --- /dev/null +++ b/docs/usage/devops_toolkit_cli.md @@ -0,0 +1,2 @@ +# Document for devops-toolkit-cli +- TODO \ No newline at end of file diff --git a/docs/usage/helm_usage.md b/docs/usage/helm_usage.md index bc2be86..2c43924 100644 --- a/docs/usage/helm_usage.md +++ b/docs/usage/helm_usage.md @@ -11,7 +11,25 @@ Some document to help you start with helm - - -## Note +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the helm command normally +helm --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container. + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -19,11 +37,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Deploy an application with Helm +### Use case 1: Deploy an application with Helm ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -58,6 +76,6 @@ CHART VERSION: 9.23.0 APP VERSION: 8.0.36 ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/kubectl_usage.md b/docs/usage/kubectl_usage.md index 8503cfd..f1aa880 100644 --- a/docs/usage/kubectl_usage.md +++ b/docs/usage/kubectl_usage.md @@ -7,7 +7,25 @@ Some document to help you start with kubernetes (k8s) - - -## Note +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the kubectl command normally +kubectl --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container. + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -15,11 +33,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Use kube config from the host +### Use case 1: Use kube config from the host Mount the `.kube/config` file from the host to container @@ -56,6 +74,6 @@ NAME READY UP-TO-DATE AVAILABLE AGE nginx-deployment 2/2 2 2 115s ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/python_usage.md b/docs/usage/python_usage.md index e00a9c5..97b7e8e 100644 --- a/docs/usage/python_usage.md +++ b/docs/usage/python_usage.md @@ -7,7 +7,25 @@ Some document to help you start with python - - -## Note +## Run with devops-toolkit-cli + +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the python command normally +python3 --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -16,11 +34,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Run python sample code provided in the container +### Use case 1: Run python sample code provided in the container ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -28,7 +46,7 @@ docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest python3 samples/python/rectangle_area_calculator.py ``` -## Use case 2: Clone external code inside container +### Use case 2: Clone external code inside container ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -46,7 +64,7 @@ cd Python python3 Day_of_week.py ``` -## Use case 3: Mount external code to container +### Use case 3: Mount external code to container Clone the code to the host then mount to container @@ -56,6 +74,6 @@ docker run --rm -v "$(pwd)":/root/python_workspace --network host -it -v ~/.dtc: # Run the python code as usual ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md) diff --git a/docs/usage/terraform_usage.md b/docs/usage/terraform_usage.md index f58caec..14617e5 100644 --- a/docs/usage/terraform_usage.md +++ b/docs/usage/terraform_usage.md @@ -7,7 +7,23 @@ Some document to help you start with terraform - - -## Note +### Start the container + +Navigate to your workspace folder, then run: + +```bash +devops-toolkit-cli init +devops-toolkit-cli run + +# You now in the container terminal. Execute the terraform command normally +terraform --version +``` + +It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container + +## Run with Docker command + +### Note To use the existing container instead of creating one, use `docker exec` command instead of `docker run` @@ -15,11 +31,11 @@ To use the existing container instead of creating one, use `docker exec` command docker exec -it my_devops_toolkit /bin/bash ``` -## Common Run Modes +### Common Run Modes For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md). -## Use case 1: Run terraform sample code provided in the container +### Use case 1: Run terraform sample code provided in the container ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -35,7 +51,7 @@ terraform destroy popd ``` -## Use case 2: Clone external code inside container +### Use case 2: Clone external code inside container ```bash docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest @@ -50,7 +66,7 @@ cd terraform-examples # Run terraform here: init-plan-apply,... ``` -## Use case 3: Mount external code to container +### Use case 3: Mount external code to container Clone the code to the host then mount to container @@ -60,6 +76,6 @@ docker run --rm -v "$(pwd)":/root/terraform_workspace -v ~/.dtc:/dtc --network h # Run the terraform code as usual ``` -## Troubleshooting +### Troubleshooting - For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)