From e4a902e73b21aa296e3c5c406e6b884c43f2c65a Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Fri, 3 Sep 2021 12:17:20 -0400 Subject: [PATCH] Set up Gitpod (#1537) * Create .gitpod.dockerfile * Create .gitpod.yml * Create database.yml.gitpod * Update .gitpod.yml * ruby 2.4.6 in gitpod.dockerfile * Update .gitpod.yml * Update database.yml.gitpod * add test database * adding && to execute everything before start commands --- .gitpod.dockerfile | 6 ++++++ .gitpod.yml | 33 +++++++++++++++++++++++++++++++++ config/database.yml.gitpod | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .gitpod.dockerfile create mode 100644 .gitpod.yml create mode 100644 config/database.yml.gitpod diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 00000000..9f9aa560 --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1,6 @@ +FROM gitpod/workspace-mysql + +# Install Ruby version 2.4.6 and set it as default +RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc +RUN bash -lc "rvm install ruby-2.4.6 && rvm use ruby-ruby-2.4.6 --default" +RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..71edeb42 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,33 @@ +image: + file: .gitpod.dockerfile +ports: + - port: 3000 + onOpen: open-preview +tasks: + - init: > + export CHROME_BIN=/usr/bin/chromium-browser && + gem install bundler && + bundle config set without 'production' && + ./lib/exporter-deps.sh > /dev/null 2>&1 && + bundle install && + cp config/database.yml.gitpod config/database.yml && + cp config/config.yml.example config/config.yml && + mysql -e "CREATE DATABASE mapknitter_development;" && + mysql -e "CREATE DATABASE mapknitter_test;" && + cp db/schema.rb.example db/schema.rb && + rake db:setup && + yarn install + command: > + passenger start + - command: chromium-browser --no-sandbox + - command: rails c + +github: + prebuilds: + branches: true + pullRequests: true + pullRequestsFromForks: true + addCheck: true + addComment: true + addBadge: false + addLabel: false diff --git a/config/database.yml.gitpod b/config/database.yml.gitpod new file mode 100644 index 00000000..af55a7dc --- /dev/null +++ b/config/database.yml.gitpod @@ -0,0 +1,20 @@ +development: + adapter: mysql2 + username: root + password: + encoding: utf8 + database: mapknitter_development + strict: false + +production: + adapter: sqlite3 + database: production.sqlite + +# Warning: The contents of the database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: mysql2 + username: root + password: + database: mapknitter_test