Skip to content

Commit a155700

Browse files
author
Shlomi Noach
authored
Merge branch 'master' into update-go-sql-driver-2020-02
2 parents 08f1717 + c6eb8db commit a155700

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

Dockerfile.packaging

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
3+
FROM golang:1.12.6
4+
5+
RUN apt-get update
6+
RUN apt-get install -y ruby ruby-dev rubygems build-essential
7+
RUN gem install --no-ri --no-rdoc fpm
8+
ENV GOPATH=/tmp/go
9+
10+
RUN apt-get install -y curl
11+
RUN apt-get install -y rsync
12+
RUN apt-get install -y gcc
13+
RUN apt-get install -y g++
14+
RUN apt-get install -y bash
15+
RUN apt-get install -y git
16+
RUN apt-get install -y tar
17+
RUN apt-get install -y rpm
18+
19+
RUN mkdir -p $GOPATH/src/github.com/github/gh-ost
20+
WORKDIR $GOPATH/src/github.com/github/gh-ost
21+
COPY . .
22+
RUN bash build.sh

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ main() {
6161

6262
mkdir -p ${buildpath}
6363
rm -rf ${buildpath:?}/*
64-
build macOS osx darwin amd64
6564
build GNU/Linux linux linux amd64
65+
# build macOS osx darwin amd64
6666

6767
echo "Binaries found in:"
68-
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz
68+
find $buildpath/gh-ost* -type f -maxdepth 1
6969
}
7070

7171
main "$@"

script/dock

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Usage:
4+
# dock <test|packages> [arg]
5+
# dock test: build gh-ost & run unit and integration tests
6+
# docker pkg [target-path]: build gh-ost release packages and copy to target path (default path: /tmp/gh-ost-release)
7+
8+
command="$1"
9+
10+
case "$command" in
11+
"test")
12+
docker_target="gh-ost-test"
13+
docker build . -f Dockerfile.test -t "${docker_target}" && docker run --rm -it "${docker_target}:latest"
14+
;;
15+
"pkg")
16+
packages_path="${2:-/tmp/gh-ost-release}"
17+
docker_target="gh-ost-packaging"
18+
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'
19+
echo "packages generated on ${packages_path}:"
20+
ls -l "${packages_path}"
21+
;;
22+
*)
23+
>&2 echo "Usage: dock dock <test|alpine|packages> [arg]"
24+
exit 1
25+
esac

0 commit comments

Comments
 (0)