This repository has been archived by the owner on Jan 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Enable remote containers and Codespaces dev #102
Merged
Merged
Conversation
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
We want to be able to run the application in a [Visual Studio Code Docker devcontainer][1] (including on [GitHub Codespaces][2]), rather than having to install all the software locally. This commit adds the [default Ruby sinatra devcontainer settings][3]. The application will not run on the devcontainer yet, as we will need to customise the container settings to install the additional software we need (e.g. Redis). We will apply these customisations in subsequent commits. [1]: https://code.visualstudio.com/docs/remote/containers [2]: https://github.com/features/codespaces [3]: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/ruby-sinatra
We will pin the gem versions in a later commit. Not doing it in this commit as want to take the smallest steps possible to get the application running successfully in a Docker devcontainer.
The version before this commit (2.5.3) is not available as a Docker devcontainer image.
[RuboCop][1] is the predominant Ruby linter. We have already been using it on this project for a long time, so it definitely needs to be on the devcontainer. [1]: https://github.com/rubocop-hq/rubocop
[Ruby RuboCop extension homepage][1] Also ensured that the RuboCop execution path and settings location are set correctly via the `devcontainer.json` file. [1]: https://github.com/misogi/vscode-ruby-rubocop
The new location was introduced in [RuboCop 0.78.0][1], via [this PR][2] [1]: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#0780-2019-12-18 [2]: rubocop/rubocop#7542
Redis is needed for the application to run locally. We set Redis to start every time the container starts or restarts.
To run the app locally on the devcontainer we use [Heroku Local][1]. We install Heroku Local using the [standalone method][2]. [1]: https://devcenter.heroku.com/articles/heroku-local [2]: https://devcenter.heroku.com/articles/heroku-cli#standalone-installation
We use [Heroku Local][1] to run the web app, so we forward Heroku Local's default port of 5000 so we can access it outside the container. [1]: https://devcenter.heroku.com/articles/heroku-local
There is no need, as it is declared in the Gemfile as one of the project's gems.
We don't use Node in this project.
The VS Code [Ruby extension highly recommends using the language server] [1], which is why we have switched to it in this commit. It integrates with RuboCop, so we have also removed the separate RuboCop extension. We are using the default language server settings suggested by the extension's homepage (except we use a globally installed RuboCop gem, rather than bundling it with the project). [1]: https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby
Added documentation for remote containers and Codespaces.
bfd209c
to
41f9178
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.