-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from patriciomacadden/bundler-cache-feature
Add bundler cache feature
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,19 @@ | ||
# Bundler cache | ||
|
||
Creates a volume for persisting the installed gems across different containers. | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"ghcr.io/rails/devcontainer/features/bundler-cache:1": {} | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
## Customizations | ||
|
||
## OS Support | ||
|
||
`bash` is required to execute the `install.sh` script. |
This file contains 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,17 @@ | ||
{ | ||
"id": "bundler-cache", | ||
"version": "1.0.0", | ||
"name": "Bundler cache", | ||
"description": "Creates a volume for persisting the installed gems across different containers", | ||
"containerEnv": { | ||
"BUNDLE_PATH": "/bundle/vendor" | ||
}, | ||
"mounts": [ | ||
{ | ||
"source": "bundler-data", | ||
"target": "/bundle", | ||
"type": "volume" | ||
} | ||
], | ||
"postCreateCommand": "/usr/local/share/bundler-data-permissions.sh" | ||
} |
This file contains 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,16 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}" | ||
|
||
POST_CREATE_COMMAND_SCRIPT_PATH="/usr/local/share/bundler-data-permissions.sh" | ||
|
||
tee "$POST_CREATE_COMMAND_SCRIPT_PATH" > /dev/null \ | ||
<< EOF | ||
#!/bin/sh | ||
set -e | ||
sudo chown -R ${USERNAME} /bundle | ||
EOF | ||
|
||
chmod 755 "$POST_CREATE_COMMAND_SCRIPT_PATH" |