aboutsummaryrefslogtreecommitdiffstats
path: root/dabuild-admin
blob: 87861d43bbb99536203a525bbb4811f0861a0748 (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
32
33
34
35
36
37
38
#!/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"
}

enable_multiarch() {
	docker run --rm --privileged multiarch/qemu-user-static \
		--reset --persistent yes --credential yes
}

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

	Available commands:
	  config: access abuild configuration
	  volumes: list created dabuild volumes
	  multiarch: enable docker multi-arch support
	  help: this help screen
	EOF
}


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