Skip to content

Commit 911b8a7

Browse files
authored
Update tool usage for devops-toolkit-cli approach (#212)
1 parent d84ef72 commit 911b8a7

File tree

9 files changed

+176
-42
lines changed

9 files changed

+176
-42
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
## Getting Started
2626

27-
Use the provided execution script simplifies setup, execution and managing DevOps Toolkit.
27+
The provided execution script simplifies the setup, execution, and management of the DevOps Toolkit.
2828

2929
### 1. Install
3030

@@ -36,11 +36,14 @@ sudo mv devops-toolkit-cli /usr/local/bin/
3636

3737
### 2. Run
3838

39+
Navigate to your workspace folder, then:
40+
3941
- Initialize the docker image, container and configuration directory:
4042

4143
```bash
4244
devops-toolkit-cli init
43-
# Run 'devops-toolkit-cli init vX.Y.Z' if you want to use specific version. E.g: devops-toolkit-cli init 1.0.2
45+
# Run 'devops-toolkit-cli init vX.Y.Z' if you want to use specific version.
46+
# E.g: devops-toolkit-cli init 1.0.2
4447
```
4548

4649
- Start a shell in new container:
@@ -61,11 +64,14 @@ devops-toolkit-cli run ls -la
6164
devops-toolkit-cli shell
6265
```
6366

64-
- For more commands, use `devops-toolkit-cli help`.
67+
### 3. Get Help
68+
69+
- For more commands, run `devops-toolkit-cli help`.
70+
- For detailed `devops-toolkit-cli` document and advanced usage, see: [docs/usage/devops_toolkit_cli](./docs/usage/devops_toolkit_cli.md)
6571

66-
## Use DevOps Toolkit with docker command directly
72+
## Use DevOps Toolkit with Docker Command Directly
6773

68-
Follow this instruction if you would like to use from docker command without the help of the execution script
74+
Follow these instructions if you prefer to use Docker commands without the help of the execution script.
6975

7076
### 1. Quick Start
7177

@@ -90,6 +96,7 @@ docker run -it --name devops-toolkit-ctn \
9096

9197
### 3. Note
9298

99+
- `.dtc` stands for **D**evOps **T**oolkit **C**onfiguration
93100
- You can replace `$HOME/.dtc` with any desired folder path on your VM.
94101
- Remove the `-v $HOME/.dtc:/dtc` option if you do not wish to store configurations on the host (not recommended for configuration reuse).
95102

@@ -107,7 +114,7 @@ docker pull tungbq/devops-toolkit:1.2.3
107114
docker pull tungbq/devops-toolkit:latest
108115
```
109116

110-
For more details on versioning, check the [release notes](https://github.com/tungbq/devops-toolkit/releases).
117+
For more details on versioning, check the [**release notes**](https://github.com/tungbq/devops-toolkit/releases).
111118

112119
## User Guide 📖
113120

docs/usage/ansible_usage.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,37 @@ Some document to help you start with ansible
77
- <https://github.com/tungbq/devops-basic/tree/main/topics/ansible>
88
- <https://www.ansible.com/>
99

10-
## Note
10+
## Run with devops-toolkit-cli
11+
12+
### Start the container
13+
14+
Navigate to your workspace folder, then run:
15+
16+
```bash
17+
devops-toolkit-cli init
18+
devops-toolkit-cli run
19+
20+
# You now in the container terminal. Execute the ansible command normally
21+
ansible --version
22+
```
23+
24+
It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container.
25+
26+
## Run with Docker command
27+
28+
### Note
1129

1230
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
1331

1432
```bash
1533
docker exec -it my_devops_toolkit /bin/bash
1634
```
1735

18-
## Common Run Modes
36+
### Common Run Modes
1937

2038
For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md).
2139

22-
## Use case 1: Run Ansible sample code provided in the container
40+
### Use case 1: Run Ansible sample code provided in the container
2341

2442
```bash
2543
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
2846
ansible-playbook samples/ansible/check_os.yml
2947
```
3048

31-
## Use case 2: Clone external code inside container
49+
### Use case 2: Clone external code inside container
3250

3351
```bash
3452
docker run --rm --network host -v ~/.dtc:/dtc -it tungbq/devops-toolkit:latest
@@ -43,7 +61,7 @@ cd ansible-examples
4361
ansible-playbook <YOUR_PLAYBOOK_CMD>
4462
```
4563

46-
## Use case 3: Mount external code to container
64+
### Use case 3: Mount external code to container
4765

4866
Clone the code to the host then mount to container
4967

@@ -53,7 +71,7 @@ docker run --rm -v "$(pwd)":/root/ansible_workspace --network host -v ~/.dtc:/dt
5371
# Run the ansible code as usual
5472
```
5573

56-
## Use case 4: Mount external code to container and use .ssh keys from the host
74+
### Use case 4: Mount external code to container and use .ssh keys from the host
5775

5876
Clone the code to the host then mount code and `.ssh` folder to container
5977

@@ -63,6 +81,6 @@ docker run --rm -v ~/.ssh:/root/.ssh -v "$(pwd)":/root/ansible_workspace --netwo
6381
# Run the ansible code as usual
6482
```
6583

66-
## Troubleshooting
84+
### Troubleshooting
6785

6886
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

docs/usage/awscli_usage.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,38 @@ Some document to help you start with awscli
1111
- <https://docs.aws.amazon.com/cli/>
1212
- <https://github.com/tungbq/devops-basic/tree/main/topics/aws>
1313

14-
## Note
14+
15+
## Run with devops-toolkit-cli
16+
17+
### Start the container
18+
19+
Navigate to your workspace folder, then run:
20+
21+
```bash
22+
devops-toolkit-cli init
23+
devops-toolkit-cli run
24+
25+
# You now in the container terminal. Execute the awscli command normally
26+
awscli --version
27+
```
28+
29+
It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container.
30+
31+
## Run with Docker command
32+
33+
### Note
1534

1635
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
1736

1837
```bash
1938
docker exec -it my_devops_toolkit /bin/bash
2039
```
2140

22-
## Common Run Modes
41+
### Common Run Modes
2342

2443
For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md).
2544

26-
## Use case 1: Configure credentials and list S3 bucket with awscli
45+
### Use case 1: Configure credentials and list S3 bucket with awscli
2746

2847
```bash
2948
docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
@@ -46,6 +65,6 @@ Default region name [None]: xxxxxxxx
4665
Default output format [None]: xxxxxxxx
4766
```
4867

49-
## Troubleshooting
68+
### Troubleshooting
5069

5170
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

docs/usage/azurecli_usage.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,44 @@ Some document to help you start with azurecli
1010

1111
- <https://learn.microsoft.com/en-us/cli/azure/>
1212

13-
## Note
13+
## Run with devops-toolkit-cli
14+
15+
### Start the container
16+
17+
Navigate to your workspace folder, then run:
18+
19+
```bash
20+
devops-toolkit-cli init
21+
devops-toolkit-cli run
22+
23+
# You now in the container terminal. Execute the az command normally
24+
az --version
25+
```
26+
27+
It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container.
28+
29+
## Run with Docker command
30+
31+
### Note
1432

1533
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
1634

1735
```bash
1836
docker exec -it my_devops_toolkit /bin/bash
1937
```
2038

21-
## Common Run Modes
39+
### Common Run Modes
2240

2341
For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md).
2442

25-
## Use case 1: Az login and run command
43+
### Use case 1: Az login and run command
2644

2745
```bash
2846
docker run --rm -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
2947

3048
# Login with AZ CLI
3149
az login --use-device-code
32-
## To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <SHOWN_IN_SCREEN> to authenticate
50+
### To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <SHOWN_IN_SCREEN> to authenticate
3351

3452
# List all resource groups
3553
az group list
@@ -55,6 +73,6 @@ root@f097467db632:~# az group list
5573
]
5674
```
5775

58-
## Troubleshooting
76+
### Troubleshooting
5977

6078
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

docs/usage/devops_toolkit_cli.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Document for devops-toolkit-cli
2+
- TODO

docs/usage/helm_usage.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,37 @@ Some document to help you start with helm
1111
- <https://helm.sh/docs/>
1212
- <https://github.com/tungbq/devops-basic/tree/main/topics/helm>
1313

14-
## Note
14+
## Run with devops-toolkit-cli
15+
16+
### Start the container
17+
18+
Navigate to your workspace folder, then run:
19+
20+
```bash
21+
devops-toolkit-cli init
22+
devops-toolkit-cli run
23+
24+
# You now in the container terminal. Execute the helm command normally
25+
helm --version
26+
```
27+
28+
It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container.
29+
30+
## Run with Docker command
31+
32+
### Note
1533

1634
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
1735

1836
```bash
1937
docker exec -it my_devops_toolkit /bin/bash
2038
```
2139

22-
## Common Run Modes
40+
### Common Run Modes
2341

2442
For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md).
2543

26-
## Use case 1: Deploy an application with Helm
44+
### Use case 1: Deploy an application with Helm
2745

2846
```bash
2947
docker run --rm --network host -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest
@@ -58,6 +76,6 @@ CHART VERSION: 9.23.0
5876
APP VERSION: 8.0.36
5977
```
6078

61-
## Troubleshooting
79+
### Troubleshooting
6280

6381
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

docs/usage/kubectl_usage.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,37 @@ Some document to help you start with kubernetes (k8s)
77
- <https://kubernetes.io/docs/home/>
88
- <https://github.com/tungbq/devops-basic/tree/main/topics/k8s>
99

10-
## Note
10+
## Run with devops-toolkit-cli
11+
12+
### Start the container
13+
14+
Navigate to your workspace folder, then run:
15+
16+
```bash
17+
devops-toolkit-cli init
18+
devops-toolkit-cli run
19+
20+
# You now in the container terminal. Execute the kubectl command normally
21+
kubectl --version
22+
```
23+
24+
It will mount the workspace code to container and you then can execute desired scripts inside the `devops-toolkit` container.
25+
26+
## Run with Docker command
27+
28+
### Note
1129

1230
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
1331

1432
```bash
1533
docker exec -it my_devops_toolkit /bin/bash
1634
```
1735

18-
## Common Run Modes
36+
### Common Run Modes
1937

2038
For instructions on common run modes, visit [**DevOps Toolkit Common Run Mode**](../usage/run_mode.md).
2139

22-
## Use case 1: Use kube config from the host
40+
### Use case 1: Use kube config from the host
2341

2442
Mount the `.kube/config` file from the host to container
2543

@@ -56,6 +74,6 @@ NAME READY UP-TO-DATE AVAILABLE AGE
5674
nginx-deployment 2/2 2 2 115s
5775
```
5876

59-
## Troubleshooting
77+
### Troubleshooting
6078

6179
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

0 commit comments

Comments
 (0)