aboutsummaryrefslogtreecommitdiffstats
path: root/dabuild-admin
blob: fe741823cc4a457a2e0e03b79ec7d52b4aa465b1 (plain)
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
#!/bin/sh

readonly cmd=$1

manage_config() {
	docker run --user 1000:1000 --rm -it --workdir /mnt/abuild \
		-v dabuild-config:/mnt/abuild alpine sh
}

list_volumes() {
	docker volume ls --quiet --filter name="^dabuild"
}

usage() {
	cat <<- EOF
	dabuild: version (unknown)

	Available commands:
	  config: access abuild configuration
	  volumes: list created dabuild volumes
	  help: this help screen
	EOF
}


case $cmd in
	config) manage_config;;
	volumes) list_volumes;;
	help) usage;;
	*) usage; exit 1;;
esac