Skip to content

Commit

Permalink
Test and build clickhouse-diagnostics in release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Jul 4, 2022
1 parent 3513b41 commit 7388b6f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
11 changes: 11 additions & 0 deletions docker/packager/binary/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ RUN arch=${TARGETARCH:-amd64} \
&& dpkg -i /tmp/nfpm.deb \
&& rm /tmp/nfpm.deb

ARG GO_VERSION=1.18.3
# We need go for clickhouse-diagnostics
RUN arch=${TARGETARCH:-amd64} \
&& curl -Lo /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz" \
&& tar -xzf /tmp/go.tgz -C /usr/local/ \
&& rm /tmp/go.tgz

ENV PATH="$PATH:/usr/local/go/bin"
ENV GOPATH=/workdir/go
ENV GOCACHE=/workdir/

RUN mkdir /workdir && chmod 777 /workdir
WORKDIR /workdir

Expand Down
15 changes: 15 additions & 0 deletions docker/packager/binary/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,21 @@ env

if [ -n "$MAKE_DEB" ]; then
rm -rf /build/packages/root
if [ -z "$SANITIZER" ]; then
# We need to check if clickhouse-diagnostics is fine and build it
(
cd /build/programs/diagnostics
make test-no-docker
GOARCH="${DEB_ARCH}" CGO_ENABLED=0 make VERSION="$VERSION_STRING" build
mv clickhouse-diagnostics ..
)
else
echo -e "#!/bin/sh\necho 'Not implemented for this type of package'" > /build/programs/clickhouse-diagnostics
chmod +x /build/programs/clickhouse-diagnostics
fi
fi


cache_status
# clear cache stats
ccache --zero-stats ||:
Expand Down Expand Up @@ -81,6 +94,8 @@ if [ -n "$MAKE_DEB" ]; then
# No quotes because I want it to expand to nothing if empty.
# shellcheck disable=SC2086
DESTDIR=/build/packages/root ninja $NINJA_FLAGS install
cp /build/programs/clickhouse-diagnostics /build/packages/root/usr/bin
cp /build/programs/clickhouse-diagnostics /output
bash -x /build/packages/build
fi

Expand Down
10 changes: 6 additions & 4 deletions packages/clickhouse-common-static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ description: |
contents:
- src: root/usr/bin/clickhouse
dst: /usr/bin/clickhouse
- src: root/usr/bin/clickhouse-odbc-bridge
dst: /usr/bin/clickhouse-odbc-bridge
- src: root/usr/bin/clickhouse-library-bridge
dst: /usr/bin/clickhouse-library-bridge
- src: root/usr/bin/clickhouse-diagnostics
dst: /usr/bin/clickhouse-diagnostics
- src: root/usr/bin/clickhouse-extract-from-config
dst: /usr/bin/clickhouse-extract-from-config
- src: root/usr/bin/clickhouse-library-bridge
dst: /usr/bin/clickhouse-library-bridge
- src: root/usr/bin/clickhouse-odbc-bridge
dst: /usr/bin/clickhouse-odbc-bridge
- src: root/usr/share/bash-completion/completions
dst: /usr/share/bash-completion/completions
# docs
Expand Down

0 comments on commit 7388b6f

Please sign in to comment.