-
Notifications
You must be signed in to change notification settings - Fork 4
Add standalone scip-ruby Docker image for CI/CD #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Build from the base image (local, not published) | ||
| ARG BASE_TAG | ||
| FROM scip-ruby-base:${BASE_TAG} | ||
|
|
||
| # This Docker image provides scip-ruby for CI/CD pipelines | ||
|
|
||
| # Default command is to run scip-ruby | ||
| CMD ["scip-ruby"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,13 @@ | ||
| FROM --platform=linux/amd64 ruby:2.7.6-alpine3.16@sha256:b014cf3e792d7130daec772241a211c40be009fc7f00e2b728ffe26805649575 | ||
| # Build from the base image (local, not published) | ||
| ARG BASE_TAG | ||
| FROM scip-ruby-base:${BASE_TAG} | ||
|
|
||
| # This Docker image is meant for auto-indexing support in Sourcegraph | ||
| # and is not recommended for third-party use. | ||
|
|
||
| # gcompat is a glibc-musl compat library (scip-ruby links in glibc) | ||
| # Other deps are to help build C extensions in gems. | ||
| RUN apk add --no-cache bash wget make libstdc++ gcc g++ automake autoconf gcompat git | ||
|
|
||
| # Use a release binary instead of building from source | ||
| # because release builds are very time-consuming. | ||
| # | ||
| # The release version is verified by tools/scripts/publish-scip-ruby.sh | ||
| 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 | ||
|
|
||
| # Copy and install the autoindex script | ||
| COPY scip_indexer/autoindex.sh /usr/bin/scip-ruby-autoindex | ||
|
|
||
| RUN chmod +x /usr/bin/scip-ruby-autoindex | ||
|
|
||
| # Default command is shell for autoindex operations | ||
| CMD ["/bin/sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| FROM --platform=linux/amd64 \ | ||
| ruby:2.7.6-alpine3.16@sha256:b014cf3e792d7130daec772241a211c40be009fc7f00e2b728ffe26805649575 | ||
|
|
||
| # This is the base Docker image for scip-ruby with common dependencies | ||
|
|
||
| # Version argument to be passed during build | ||
| ARG SCIP_RUBY_VERSION | ||
|
|
||
| # Fail if SCIP_RUBY_VERSION is not provided | ||
| RUN test -n "${SCIP_RUBY_VERSION}" || \ | ||
| (echo "ERROR: SCIP_RUBY_VERSION build arg is required" && exit 1) | ||
|
|
||
| # gcompat is a glibc-musl compat library (scip-ruby links in glibc) | ||
| # Other deps are to help build C extensions in gems. | ||
| RUN apk add --no-cache \ | ||
| bash \ | ||
| wget \ | ||
| make \ | ||
| libstdc++ \ | ||
| gcc \ | ||
| g++ \ | ||
| automake \ | ||
| autoconf \ | ||
| gcompat \ | ||
| git | ||
|
|
||
| # Use a release binary instead of building from source | ||
| # because release builds are very time-consuming. | ||
| # | ||
| # The release version is verified by tools/scripts/publish-scip-ruby.sh | ||
| # The binary at this version is guaranteed to exist because this workflow runs either: | ||
| # 1. Manually with a specific tag that already has a release | ||
| # 2. After the Release workflow completes (which creates the release and uploads the binary) | ||
| RUN wget https://github.com/sourcegraph/scip-ruby/releases/download/scip-ruby-v${SCIP_RUBY_VERSION}/scip-ruby-x86_64-linux \ | ||
| -O /usr/bin/scip-ruby && \ | ||
| chmod +x /usr/bin/scip-ruby | ||
|
|
||
| # Set working directory for sources | ||
| WORKDIR /sources | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to break, because the version number is no longer hard-coded in the URL, so the publishing script cannot cross-check this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow. The publishing step building this image sets
SCIP_RUBY_VERSION=${{ env.PATCH }}.In case this value is not passed we can return an error: