Skip to content

Commit

Permalink
Improving directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
fmdlc committed Oct 25, 2020
1 parent 9eaf212 commit 1514e43
Show file tree
Hide file tree
Showing 14 changed files with 7,439 additions and 448 deletions.
21 changes: 14 additions & 7 deletions ISP-Checker/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ NAME=ISP-Checker
VERSION=1.2
AUTHOR="Facu de la Cruz <[email protected]>"

COMPOSE_FILE="./docker/docker-compose.yaml"
COMPOSE_FILE="./docker-compose/docker-compose.yaml"

default:
@echo "USAGE: make <TARGET>"
@echo ""
@echo "\t- install: Bootstrap components."
@echo "\t- start : Start entire stack."
@echo "\t- stop : Stops entire stack."
@echo "\t- restart: Restart stack.\n"
@echo "\t- install : Bootstrap components in docker-compose"
@echo "\t- kube-install: Bootstrap components in K8s cluster."
@echo "\t- start : Start entire stack."
@echo "\t- stop : Stops entire stack."
@echo "\t- restart : Restart stack.\n"

install:
$(info Make: Creating persistent Docker volumes)
@bash ./bin/inject_credentials.sh
@bash ./docker-compose/bin/inject_credentials.sh
@docker volume create --name=influxdb-storage
@docker volume create --name=grafana-storage

Expand All @@ -32,6 +33,10 @@ install:
-s --location -XPOST 'http://admin:[email protected]:3000/api/dashboards/db' \
--header 'Content-Type: application/json' -d @/app/network-dashboard.json > /dev/null

@docker run --network host -v "$(PWD)/grafana:/app" --rm curlimages/curl:7.73.0 \
-s --location -XPOST 'http://admin:[email protected]:3000/api/dashboards/db' \
--header 'Content-Type: application/json' -d @/app/raspberry-dashboard.json > /dev/null

@docker run --network host -v "$(PWD)/grafana:/app" --rm curlimages/curl:7.73.0 \
-s --location -XPUT 'http://admin:[email protected]:3000/api/user/preferences' \
--header 'Content-Type: application/json' -d @/app/default.json > /dev/null
Expand All @@ -41,6 +46,9 @@ install:
@echo "Updated credentials after your first login!."
$(info Make: Bootstrap done)

kube-install:
kubectl apply -f https://raw.githubusercontent.com/fmdlc/ISP-Checker/master/kubernetes/ISP-Checker-deploy.yaml

start:
docker-compose -f $(COMPOSE_FILE) up -d

Expand All @@ -55,4 +63,3 @@ prune:
docker rm `docker ps -a -q`
docker volume rm influxdb-storage
docker volume rm grafana-storage

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ Go to the `./ISP-Checker` directory, see the Makefile on this directory.
$: make
USAGE: make <TARGET>

- install: Bootstrap components.
- start : Start entire stack.
- stop : Stops entire stack.
- restart: Restart stack.
- install : Bootstrap components in `docker-compose`.
- kube-install: Bootstrap components in k8s cluster.
- start : Start entire stack.
- stop : Stops entire stack.
- restart : Restart stack.
```

Execute `make install` to install.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

source ./credentials.env
cat > ./grafana/datasource.json <<EOF
source ./docker-compose/credentials.env
cat > ./docker-compose/grafana/datasource.json <<EOF
{
"access": "proxy",
"basicAuth": false,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
volumes:
- "influxdb-storage:/var/influxdb/data"
env_file:
- ../credentials.env
- ./credentials.env
ports:
- 8086:8086
telegraf:
Expand All @@ -24,7 +24,7 @@ services:
volumes:
- "../telegraf/conf/telegraf.conf:/etc/telegraf/telegraf.conf"
env_file:
- ../credentials.env
- ./credentials.env
links:
- "influxdb"
depends_on:
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 1514e43

Please sign in to comment.