-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitpod.yml
More file actions
43 lines (38 loc) · 1.4 KB
/
.gitpod.yml
File metadata and controls
43 lines (38 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
tasks:
- name: Setup Rails App
command: |
if [ ! -d "./app" ]; then
echo "Creating new Rails app with postgresql database..."
docker-compose run --no-deps myrailsapp rails new . --force --database=postgresql
echo "Changing ownership of the newly created files..."
sudo chown -R $USER:$USER .
echo "Rebuilding the Docker image..."
docker-compose build
echo "Replacing config/database.yml with provided settings..."
echo "default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } %>
host: <%= ENV.fetch('DB_HOST', 'localhost') %>
database: <%= ENV['DB_NAME'] %>
username: <%= ENV['DB_USERNAME'] %>
password: <%= ENV['DB_PASSWORD'] %>
development:
<<: *default
test:
<<: *default" > config/database.yml
echo "Inserting config.hosts << /.*\.gitpod\.io/ into development.rb"
sed -i "/Rails.application.configure do/a \ config.hosts << /.*\.gitpod\.io/" config/environments/development.rb
else
echo "App already exists, skipping setup..."
fi
echo "Launching the App"
docker-compose up
vscode:
extensions:
- ms-azuretools.vscode-docker
- shd101wyy.markdown-preview-enhanced
- vortizhe.simple-ruby-erb
- CraigMaslowski.erb
- Vense.rails-snippets
- wingrunr21.vscode-ruby