-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasker
executable file
·39 lines (29 loc) · 822 Bytes
/
tasker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -e
if [ ! -f ./node_modules/@thecotne/tasker/tasker-core ]; then
yarn
fi
source ./node_modules/@thecotne/tasker/tasker-core
IMAGE_NAME=${PWD##*/}
function start { # start mining
node ./src/miner.js
}
function docker-start { # start mining in docker container
docker build -t $IMAGE_NAME .
docker run $IMAGE_NAME
}
function docker-stop-containers { # stop all docker containers
docker stop $(docker ps -a -q)
}
function docker-destroy-containers { # destroy all docker containers
docker rm $(docker ps -a -q)
}
function docker-destroy-images { # destroy all docker images
docker rmi $(docker images -q)
}
function docker-destroy-all { # destory all docker images and containers
docker-stop-containers
docker-destroy-containers
docker-destroy-images
}
_bootstrap "${@}"