Skip to content
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

steps missing from devcontainer setup #4

Open
zachariahcox opened this issue Feb 22, 2022 · 0 comments
Open

steps missing from devcontainer setup #4

zachariahcox opened this issue Feb 22, 2022 · 0 comments

Comments

@zachariahcox
Copy link

we basically need the following commands added as an on-create script (or added to the docker file, etc):

create a file with executable permissions 755
call that file from the "onCreateCommand" hook.

file should contain:

bundle install
yarn install
bin/rails db:setup

In my branch it looks like this:

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index b0a9069..76ece07 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -31,5 +31,8 @@
        "remoteUser": "vscode",
        "features": {
                "git": "os-provided"
-       }
+       },
+       
+       // Runs automatically after Prebuild Template environment is created.
+       "onCreateCommand": ".devcontainer/on-create-command.sh"
 }
diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh
new file mode 100755
index 0000000..269e24c
--- /dev/null
+++ b/.devcontainer/on-create-command.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -e
+
+bundle install
+yarn install
+bin/rails db:setup
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant