-
Notifications
You must be signed in to change notification settings - Fork 55
CC-1188: add crystal dependency resolution #192
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
server |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2.0 | ||
shards: | ||
kiwi: | ||
git: https://github.com/crystal-community/kiwi.git | ||
version: 0.1.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: build-your-own-redis | ||
version: 0.1.0 | ||
|
||
dependencies: | ||
kiwi: | ||
github: crystal-community/kiwi | ||
version: ~> 0.1.0 | ||
|
||
authors: | ||
- CodeCrafters <[email protected]> | ||
|
||
targets: | ||
server: | ||
main: app/main.cr | ||
|
||
crystal: '>= 1.12.1' | ||
|
||
license: MIT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM crystallang/crystal:1.12-alpine | ||
|
||
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="shard.yml, shard.lock" | ||
ryan-gang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
WORKDIR /app | ||
COPY shard.yml shard.lock ./ | ||
|
||
RUN shards install --frozen | ||
|
||
RUN mkdir -p /app-cached/ | ||
RUN if [ -d "/app/lib" ]; then mv /app/lib /app-cached/lib; fi | ||
|
||
RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && crystal build -p -s -t -o server app/main.cr && sed -i '/^crystal/ s/^/# /' ./spawn_redis_server.sh" > /codecrafters-precompile.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not pertinent to this PR, but just wanted to note: looks like this pattern is becoming commonplace in a lot of our languages. Need to find a better solution. This commenting stuff feels wonky - if a user edits the file it isn't going to be clear to them that there's a hidden script that relies on the file's structure. |
||
RUN chmod +x /codecrafters-precompile.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Binaries typically get placed in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lib/ is where the dependencies are stored. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No other build artifacts would be there in the /app dir. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2.0 | ||
shards: | ||
kiwi: | ||
git: https://github.com/crystal-community/kiwi.git | ||
version: 0.1.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: build-your-own-redis | ||
version: 0.1.0 | ||
|
||
dependencies: | ||
kiwi: | ||
github: crystal-community/kiwi | ||
version: ~> 0.1.0 | ||
|
||
authors: | ||
- CodeCrafters <[email protected]> | ||
|
||
targets: | ||
server: | ||
main: app/main.cr | ||
|
||
crystal: '>= 1.12.1' | ||
|
||
license: MIT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
server |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2.0 | ||
shards: | ||
kiwi: | ||
git: https://github.com/crystal-community/kiwi.git | ||
version: 0.1.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: build-your-own-redis | ||
version: 0.1.0 | ||
|
||
dependencies: | ||
kiwi: | ||
github: crystal-community/kiwi | ||
version: ~> 0.1.0 | ||
|
||
authors: | ||
- CodeCrafters <[email protected]> | ||
|
||
targets: | ||
server: | ||
main: app/main.cr | ||
|
||
crystal: '>= 1.12.1' | ||
|
||
license: MIT |
Uh oh!
There was an error while loading. Please reload this page.