generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
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 #5378 from DFE-Digital/3847-fix-codespaces
Fix GitHub codespaces
- Loading branch information
Showing
6 changed files
with
60 additions
and
25 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 |
---|---|---|
@@ -1 +1,12 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04 | ||
|
||
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev,.app.github.dev" \ | ||
CODESPACES="true" \ | ||
DB_HOST="postgres" \ | ||
DB_USERNAME="postgres" \ | ||
DB_PASSWORD="postgres" | ||
|
||
# Adding the PostgreSQL repository so we can install postgresql-client v15 | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg |
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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
#!/bin/bash | ||
|
||
echo "Setting SSH password for vscode user..." | ||
sudo usermod --password $(echo vscode | openssl passwd -1 -stdin) vscode | ||
|
||
echo "Updating RubyGems..." | ||
gem update --system | ||
gem update --system -N | ||
|
||
echo "Installing dependencies..." | ||
gem install bundler -v 2.4.14 # Must be explicitly specified or we get an error on the subsequent bundle install. | ||
bundle install | ||
yarn install | ||
yarn build | ||
yarn build:css | ||
|
||
echo "Creating database..." | ||
bin/rails db:create db:schema:load db:migrate db:seed | ||
bin/rails db:create db:schema:load | ||
|
||
echo "Seeding database..." | ||
bin/rails db:seed | ||
|
||
echo "Installing documentation dependencies..." | ||
cd docs | ||
gem install bundler -v 2.4.6 # Must be explicitly specified or we get an error on the subsequent bundle install. | ||
bundle install | ||
|
||
echo "Installing documentation dependencies" | ||
cd docs && bundle | ||
echo "Building documentation..." | ||
bundle exec middleman build --build-dir=../public/api-reference | ||
|
||
echo "Done!" |
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,2 @@ | ||
CREATE USER vscode CREATEDB; | ||
CREATE DATABASE vscode WITH OWNER vscode; |
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
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
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