File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,14 +42,40 @@ jobs:
4242 with :
4343 username : ${{ secrets.DOCKER_USERNAME }}
4444 password : ${{ secrets.DOCKER_PASSWORD }}
45- - name : Build and push
45+ - name : Build base image (not published)
46+ id : docker_build_base
47+ uses : docker/build-push-action@v6
48+ with :
49+ file : Dockerfile.base
50+ push : false
51+ load : true
52+ build-args : |
53+ SCIP_RUBY_VERSION=${{ env.PATCH }}
54+ tags : |
55+ scip-ruby-base:${{ env.PATCH }}
56+ - name : Build and push autoindex image
4657 id : docker_build_autoindex
4758 uses : docker/build-push-action@v6
4859 with :
4960 file : Dockerfile.autoindex
5061 push : true
62+ build-args : |
63+ BASE_TAG=${{ env.PATCH }}
5164 tags : |
5265 sourcegraph/scip-ruby:autoindex
5366 sourcegraph/scip-ruby:autoindex-${{ env.PATCH }}
5467 sourcegraph/scip-ruby:autoindex-${{ env.MINOR }}
5568 sourcegraph/scip-ruby:autoindex-${{ env.MAJOR }}
69+ - name : Build and push scip-ruby image
70+ id : docker_build_scip_ruby
71+ uses : docker/build-push-action@v6
72+ with :
73+ file : Dockerfile
74+ push : true
75+ build-args : |
76+ BASE_TAG=${{ env.PATCH }}
77+ tags : |
78+ sourcegraph/scip-ruby:latest
79+ sourcegraph/scip-ruby:${{ env.PATCH }}
80+ sourcegraph/scip-ruby:${{ env.MINOR }}
81+ sourcegraph/scip-ruby:${{ env.MAJOR }}
Original file line number Diff line number Diff line change 1+ # Build from the base image (local, not published)
2+ ARG BASE_TAG
3+ FROM scip-ruby-base:${BASE_TAG}
4+
5+ # This Docker image provides scip-ruby for CI/CD pipelines
6+
7+ # Default command is to run scip-ruby
8+ CMD ["scip-ruby" ]
Original file line number Diff line number Diff line change 1- FROM --platform=linux/amd64 ruby:2.7.6-alpine3.16@sha256:b014cf3e792d7130daec772241a211c40be009fc7f00e2b728ffe26805649575
1+ # Build from the base image (local, not published)
2+ ARG BASE_TAG
3+ FROM scip-ruby-base:${BASE_TAG}
24
35# This Docker image is meant for auto-indexing support in Sourcegraph
46# and is not recommended for third-party use.
57
6- # gcompat is a glibc-musl compat library (scip-ruby links in glibc)
7- # Other deps are to help build C extensions in gems.
8- RUN apk add --no-cache bash wget make libstdc++ gcc g++ automake autoconf gcompat git
9-
10- # Use a release binary instead of building from source
11- # because release builds are very time-consuming.
12- #
13- # The release version is verified by tools/scripts/publish-scip-ruby.sh
14- RUN wget https://github.com/sourcegraph/scip-ruby/releases/download/scip-ruby-v0.4.6/scip-ruby-x86_64-linux -O /usr/bin/scip-ruby && chmod +x /usr/bin/scip-ruby
15-
8+ # Copy and install the autoindex script
169COPY scip_indexer/autoindex.sh /usr/bin/scip-ruby-autoindex
17-
1810RUN chmod +x /usr/bin/scip-ruby-autoindex
1911
12+ # Default command is shell for autoindex operations
2013CMD ["/bin/sh"]
Original file line number Diff line number Diff line change 1+ FROM --platform=linux/amd64 \
2+ ruby:2.7.6-alpine3.16@sha256:b014cf3e792d7130daec772241a211c40be009fc7f00e2b728ffe26805649575
3+
4+ # This is the base Docker image for scip-ruby with common dependencies
5+
6+ # Version argument to be passed during build
7+ ARG SCIP_RUBY_VERSION
8+
9+ # gcompat is a glibc-musl compat library (scip-ruby links in glibc)
10+ # Other deps are to help build C extensions in gems.
11+ RUN apk add --no-cache \
12+ bash \
13+ wget \
14+ make \
15+ libstdc++ \
16+ gcc \
17+ g++ \
18+ automake \
19+ autoconf \
20+ gcompat \
21+ git
22+
23+ # Use a release binary instead of building from source
24+ # because release builds are very time-consuming.
25+ #
26+ # The release version is verified by tools/scripts/publish-scip-ruby.sh
27+ # The binary at this version is guaranteed to exist because this workflow runs either:
28+ # 1. Manually with a specific tag that already has a release
29+ # 2. After the Release workflow completes (which creates the release and uploads the binary)
30+ RUN wget https://github.com/sourcegraph/scip-ruby/releases/download/scip-ruby-v${SCIP_RUBY_VERSION}/scip-ruby-x86_64-linux \
31+ -O /usr/bin/scip-ruby && \
32+ chmod +x /usr/bin/scip-ruby
33+
34+ # Set working directory for sources
35+ WORKDIR /sources
You can’t perform that action at this time.
0 commit comments