Adding script/dock: simplifying testing/packaging

This commit is contained in:
Shlomi Noach 2020-02-09 16:11:34 +02:00
parent 8bdf2d2dbd
commit 40953fe82f
2 changed files with 3 additions and 8 deletions

View File

@ -61,11 +61,11 @@ main() {
mkdir -p ${buildpath} mkdir -p ${buildpath}
rm -rf ${buildpath:?}/* rm -rf ${buildpath:?}/*
build macOS osx darwin amd64
build GNU/Linux linux linux amd64 build GNU/Linux linux linux amd64
# build macOS osx darwin amd64
echo "Binaries found in:" echo "Binaries found in:"
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz find $buildpath/gh-ost* -type f -maxdepth 1
} }
main "$@" main "$@"

View File

@ -1,9 +1,8 @@
#!/bin/bash #!/bin/bash
# Usage: # Usage:
# dock <test|alpine|packages> [arg] # dock <test|packages> [arg]
# dock test: build gh-ost & run unit and integration tests # dock test: build gh-ost & run unit and integration tests
# docker alpine: build and run gh-ost on alpine linux
# docker pkg [target-path]: build gh-ost release packages and copy to target path (default path: /tmp/gh-ost-release) # docker pkg [target-path]: build gh-ost release packages and copy to target path (default path: /tmp/gh-ost-release)
command="$1" command="$1"
@ -13,10 +12,6 @@ case "$command" in
docker_target="gh-ost-test" docker_target="gh-ost-test"
docker build . -f Dockerfile.test -t "${docker_target}" && docker run --rm -it "${docker_target}:latest" docker build . -f Dockerfile.test -t "${docker_target}" && docker run --rm -it "${docker_target}:latest"
;; ;;
"alpine")
docker_target="gh-ost-alpine"
docker build . -f Dockerfile -t "${docker_target}" && docker run --rm -it -p 3000:3000 "${docker_target}:latest"
;;
"pkg") "pkg")
packages_path="${2:-/tmp/gh-ost-release}" packages_path="${2:-/tmp/gh-ost-release}"
docker_target="gh-ost-packaging" docker_target="gh-ost-packaging"