You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-17Lines changed: 75 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -19,36 +19,94 @@ tar -xvzf strikes-0.0.1-alpha-x86_64-unknown-linux-musl.tar.gz -C <path-to-insta
19
19
After extracting the binary, you may need to add the path to your PATH environment variable.
20
20
21
21
## Usage
22
-
- Add a strike to a user
23
22
```bash
24
-
strikes strike <user>
25
-
```
23
+
Simple CLI tool to track and assign strikes
26
24
27
-
- List all strikes
28
-
```bash
29
-
strikes ls
30
-
```
25
+
Usage: strikes [OPTIONS] [COMMAND]
31
26
32
-
- Clear all strikes
33
-
```bash
34
-
strikes clear
27
+
Commands:
28
+
strike Add a strike
29
+
ls List all strikes
30
+
clear Clear strikes
31
+
check-health Check health of the client
32
+
help Print this message or the help of the given subcommand(s)
33
+
34
+
Options:
35
+
-c, --config-path <CONFIG_PATH>
36
+
Specify the path to the configuration file
37
+
38
+
-h, --help
39
+
Print help (see a summary with '-h')
40
+
41
+
-V, --version
42
+
Print version
35
43
```
36
44
37
-
## Use locally only
45
+
## Use with a remote server
46
+
You can use a remote server to store the strikes. Either you get access to an existing server or you can deploy the infractructure to your AWS account yourself.
47
+
Anyways you need to provide the URL to the server and an API key.
48
+
49
+
## Use locally
38
50
You can use the local client without a remote server.
39
51
It will generate a JSON file where the strikes are stored.
40
-
The default path is in your home directory at '.strikes/db.json'.
41
-
You can configure a different location by using the '--db-path' argument or by providing a configuration file.
42
-
The argument has precedence over the configuration file.
43
52
44
-
###Configuration file
45
-
The configuration file needs to be a yaml file.
53
+
## Configuration file
54
+
Provide a configuration file at ./strikes/configuration.yaml. The remote server configuration has precedence over the local configuration.
46
55
47
56
```yaml
57
+
remote:
58
+
base_rul: "https://strikes.example.com"
59
+
api_key: "your-api-key"
48
60
local:
49
-
db_path: /path/to/db.json
61
+
db_path: "/path/to/db.json"
50
62
```
51
63
64
+
You can configure a different configuration file location by using the '--config-path' argument.
65
+
The argument has precedence over the configuration file.
First of all you need to create a S3 bucket to store the terraform state. Navigate to the infrastructure/remote-state directory and run:
81
+
```bash
82
+
terraform init
83
+
terraform plan
84
+
terraform apply
85
+
```
86
+
This will create a S3 bucket and a DynamoDB table to store the terraform state. Afterwards you can deploy the infrastructure by navigating to the infrastructure directory and running:
87
+
88
+
```bash
89
+
terraform init
90
+
terraform plan
91
+
terraform apply
92
+
```
93
+
94
+
### How to test the cli-client
95
+
Navigate to cli-client and run:
96
+
```bash
97
+
cargo test
98
+
```
99
+
100
+
### How to test the infrastructure lambdas
101
+
Navigate to infrastructure/lambdas/tests and run:
102
+
103
+
```bash
104
+
docker-compose up -d
105
+
```
106
+
107
+
This will set up a DynamoDB local instance. Afterwards navigate back to infrastructure/lambdas and run:
0 commit comments