forked from crdoconnor/strictyaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
key.sh
executable file
·45 lines (41 loc) · 1.18 KB
/
key.sh
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
40
41
42
43
44
45
#!/bin/bash
set -e
PROJECT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
hitchrun() {
podman run --privileged -it --rm \
-v $PROJECT_DIR:/src \
-v strictyaml-hitch-container:/gen \
-v ~/.ssh/id_rsa:/root/.ssh/id_rsa \
-v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \
--workdir /src \
strictyaml-hitch \
$1
}
case "$1" in
"clean")
if podman volume exists strictyaml-hitch-container; then
podman volume rm strictyaml-hitch-container
fi
if podman image exists strictyaml-hitch; then
podman image rm -f strictyaml-hitch
fi
;;
"make")
echo "building ci container..."
if ! podman volume exists strictyaml-hitch-container; then
podman volume create strictyaml-hitch-container
fi
podman build -f hitch/Dockerfile-hitch -t strictyaml-hitch $PROJECT_DIR
;;
"bash")
hitchrun "bash"
;;
"--help")
echo "Commands:"
echo "./run.sh make - build docker containers."
;;
*)
hitchrun "/venv/bin/python hitch/key.py $1 $2 $3 $4 $5 $6 $7 $8 $9"
;;
esac
exit