Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 1e73f3e

Browse files
author
Amblizer
committed
move ENV setting to devcontainer.json, update README
1 parent f5ab366 commit 1e73f3e

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

containers/ruby-2-rails-5/.devcontainer/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,4 @@ RUN apt-get autoremove -y \
3737
&& rm -rf /var/lib/apt/lists/*
3838

3939
# Set the default shell to bash instead of sh
40-
ENV SHELL /bin/bash
41-
42-
ENV PROJECT_NAME test-project
40+
ENV SHELL /bin/bash

containers/ruby-2-rails-5/.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"rebornix.Ruby",
66
"craigmaslowski.erb"
77
],
8+
"runArgs": [
9+
// change this to your project name to debug
10+
"-e", "PROJECT_NAME=test-project"
11+
],
812
// Uncomment the next line if you want to publish any ports.
913
// "appPort": ["80:80"],
1014

containers/ruby-2-rails-5/.vscode/tasks.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,10 @@
33
// for the documentation about the tasks.json format
44
"version": "2.0.0",
55
"tasks": [
6-
{ // 2. bundle install in project folder
6+
{ // bundle install in project folder
77
"label": "bundleInstall",
8-
"dependsOn": "setEnv", // sequential
98
"type": "shell",
10-
"command": "cd ${env:PROJECT_NAME} && bundle install"
9+
"command": "cd ${env:PROJECT_NAME} && bundle install && gem cleanup"
1110
},
12-
{ // 1. input project name and set as env variable, the only way
13-
// to share it to launch.json. You can also hard code it.
14-
"label": "setEnv",
15-
"type": "shell",
16-
"command": "export PROJECT_NAME=${input:projectName}"
17-
}
1811
],
19-
"inputs": [
20-
{ // prompt user to input project name for debugging
21-
"type": "promptString",
22-
"id": "projectName",
23-
"description": "Please input the name of the project to debug.",
24-
"default": "test-project"
25-
}
26-
]
2712
}

containers/ruby-2-rails-5/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This definition includes some test code that will help you verify it is working
3838
2. Clone this repository.
3939
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4040
4. Select the `containers/ruby-2-rails-5` folder.
41-
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project. Enter the name of the project to debug at popup input bar (it is populated for the test-project).
42-
6. You should see "* Listening on tcp://0.0.0.0:80" in the Debug Console. press <kbd>F1</kbd>. Select **Remote-Containers: Forward Porrt From Container...** then choose **Forward 80**, and by browsing http://localhost/ you should see "Yay! You’re on Rails!".
41+
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
42+
6. You should see "* Listening on tcp://0.0.0.0:80" in the Debug Console. Press <kbd>F1</kbd>. Select **Remote-Containers: Forward Porrt From Container...** then choose **Forward 80**, and by browsing http://localhost/ you should see "Yay! You’re on Rails!".
4343
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
4444

4545
## License

0 commit comments

Comments
 (0)