Add universal ctags to zoekt CI image

This commit is contained in:
John Mason 2024-03-01 16:38:11 +00:00 committed by Stan Hu
parent 2a15b1419d
commit d3631defa8
2 changed files with 48 additions and 0 deletions

View file

@ -71,6 +71,9 @@ zoekt-ci-image-1.6:
zoekt-ci-image-1.7: zoekt-ci-image-1.7:
extends: .build_static_image extends: .build_static_image
zoekt-ci-image-1.8:
extends: .build_static_image
postgres-12-pgvector-0.4.1: postgres-12-pgvector-0.4.1:
extends: .build_static_image extends: .build_static_image

View file

@ -0,0 +1,45 @@
FROM golang:1.20.0-alpine3.17 as build
WORKDIR /usr/src/app
RUN apk add git
ENV ZOEKT_VERSION=fcb279ae404c0aa102121b28257143ad16e77482
ENV GITLAB_ZOEKT_INDEXER_VERSION=2ff7245c079d350ac920d92fbcd4d32a078ac4b3
RUN apk add go && \
go install github.com/sourcegraph/zoekt/cmd/zoekt-webserver@$ZOEKT_VERSION && \
go install gitlab.com/gitlab-org/gitlab-zoekt-indexer/cmd/gitlab-zoekt-indexer@$GITLAB_ZOEKT_INDEXER_VERSION && \
rm -rf /go/pkg /go/src /usr/local/go
FROM alpine:3.17 as main
COPY --from=build /go/bin/* /usr/bin/
COPY assets/zoekt-ci-image/run-zoekt-servers run-zoekt-servers
RUN \
# add runtime dependencies
apk --update --no-cache add jansson yaml libxml2 && \
# add build dependencies
apk --update --no-cache add --virtual build-deps \
git autoconf make gcc automake musl-dev \
jansson-dev yaml-dev libxml2-dev && \
# build, install universal-ctags
git clone http://github.com/universal-ctags/ctags.git ~/ctags && \
cd ~/ctags && \
./autogen.sh && \
./configure --program-prefix=u && \
make && make install && \
# cleanup
cd ~ && rm -rf ctags && \
apk del build-deps
ENV CTAGS_COMMAND=/usr/local/bin/uctags
VOLUME /zoekt/test/index
EXPOSE 6060
EXPOSE 6070
CMD ["sh", "run-zoekt-servers"]