Skip to content

Commit dbb214a

Browse files
committed
Fix quick_start script
1 parent 796d837 commit dbb214a

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ ci/
4040

4141
.env
4242
venv/
43-
mongodb-datasource/
43+
mongodb-datasource/
44+
grafana-storage/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ This plugin enables you to query and visualize data from your MongoDB databases
2121

2222
## Getting Started
2323
### Quick start
24-
Run the script `scripts/start_docker.py` to start a MongoDB and Grafana container with the plugin
24+
Run the script `scripts/quick_start.py` to start a MongoDB and Grafana container with the plugin
2525
```
26-
python3 scripts/start_docker.py
26+
python3 scripts/quick_start.py
2727
```
2828
### Full steps
2929
1. **Download:** Obtain the latest plugin build from the [Release page](https://github.com/haohanyang/mongodb-datasource/releases) or [workflow artifacts](https://github.com/haohanyang/mongodb-datasource/actions?query=branch%3Amaster).

scripts/start_docker.py renamed to scripts/quick_start.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import glob
77
import subprocess
88
import shutil
9+
from sys import platform
910

1011
dist_dir = "mongodb-datasource"
1112
if os.path.isdir(dist_dir):
@@ -31,8 +32,12 @@
3132

3233
# Grant execute permission go binaries
3334
for bin in glob.glob("mongodb-datasource/gpx_mongodb_datasource_*"):
34-
os.chmod(bin, 755)
35+
os.chmod(bin, os.stat(bin).st_mode | 755)
3536

36-
subprocess.call(
37-
["sudo", "docker", "compose", "-f", "docker-compose.prod.yaml", "up", "-d"]
38-
)
37+
if platform == "linux" or platform == "linux2":
38+
# "sudo" only for linux
39+
subprocess.call(
40+
["sudo", "docker", "compose", "-f", "docker-compose.prod.yaml", "up", "-d"]
41+
)
42+
else:
43+
subprocess.call(["docker", "compose", "-f", "docker-compose.prod.yaml", "up", "-d"])

0 commit comments

Comments
 (0)