-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add quickstart script for Codespaces environment #2798
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?
Add quickstart script for Codespaces environment #2798
Conversation
|
It's funny that you add this today, as that's what I've been working on for much of this week. We're trying to see if we can use Codespaces for certain client projects to reduce the onboarding burden, and if it works well enough it makes sense to support it here too. I'm still deep in the middle of figuring out what the ideal setup might be like, but I'll come back to this soon. |
|
Last year, setting up an environment to run RSpec in Codespaces was quite challenging due to the difficulty of installing a headless browser in the container image at the time, as well as compatibility issues with WebDriver. However, these problems have been resolved in the current container image, and now RSpec runs smoothly with just the execution of the newly added script. For the past few months, I have been using this script to launch Codespaces and work on PRs, and I have found it to be quite comfortable. Previously, I had stored the script in a Gist and had to manually copy and paste it each time to set up the environment. I created this PR because I thought it would be more convenient to have it readily available in the repository. |
|
Ooh, that's really good to know, thanks! I had some comments of previous problems, but no one's been clear enough with me what they actually struggled with. |
|
One small issue remains. Currently, since only Foreman loads Dotenv, any command other than export DATABASE_URL=postgresql://postgres:@localhostThis needs to be set for each terminal session, which is a bit inconvenient, but once we get used to it, it’s not a big deal. Do you have any ideas? |
| export DATABASE_URL=postgresql://postgres:@localhost | ||
|
|
||
| ./bin/setup | ||
| ./bin/setup |
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.
Is setup running twice by accident or on purpose?
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.
It's on purpose. The first execution always stops at this point, so a second execution is necessary.
https://github.com/thoughtbot/administrate/blob/main/bin/setup#L12
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.
Oh, of course. Thank you. How about a comment to remove the confusion?
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.
Added comments!
df295a5 to
0b2e80a
Compare
No, not really. The simplest way is to add the echo "" >> ~/.bashrc && echo "export DATABASE_URL=postgresql://postgres:@localhost" >> ~/.bashrc |
|
Ah, interesting. I've so far gone down the path of figuring out how to setup a |
How about recommending the use of Codespaces to make contributions easier?
With this script, we can launch a clean environment for any branch in just three minutes and discard it when it's no longer needed.
To set up the environment, run the following command:
source bin/setup-codespaces bin/devWhat do you think?
Let me know if there are any other necessary tasks, such as updating the README.