File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Usage:
4+ # dock <test|alpine|packages> [arg]
5+ # dock test: build gh-ost & run unit and integration tests
6+ # docker alpine: build and run gh-ost on alpine linux
7+ # docker pkg [target-path]: build gh-ost release packages and copy to target path (default path: /tmp/gh-ost-release)
8+
9+ command=" $1 "
10+
11+ case " $command " in
12+ " test" )
13+ docker_target=" gh-ost-test"
14+ docker build . -f Dockerfile.test -t " ${docker_target} " && docker run --rm -it " ${docker_target} :latest"
15+ ;;
16+ " alpine" )
17+ docker_target=" gh-ost-alpine"
18+ docker build . -f Dockerfile -t " ${docker_target} " && docker run --rm -it -p 3000:3000 " ${docker_target} :latest"
19+ ;;
20+ " pkg" )
21+ packages_path=" ${2:-/ tmp/ gh-ost-release} "
22+ docker_target=" gh-ost-packaging"
23+ docker build . -f Dockerfile.packaging -t " ${docker_target} " && docker run --rm -it -v " ${packages_path} :/tmp/pkg" " ${docker_target} :latest" bash -c ' find /tmp/gh-ost-release/ -maxdepth 1 -type f | xargs cp -t /tmp/pkg'
24+ echo " packages generated on ${packages_path} :"
25+ ls -l " ${packages_path} "
26+ ;;
27+ * )
28+ >&2 echo " Usage: dock dock <test|alpine|packages> [arg]"
29+ exit 1
30+ esac
You can’t perform that action at this time.
0 commit comments