Skip to content
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

One-click development environment via Gitpod.io (browser-based VSCode with cloud backend) #916

Merged
merged 37 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
90a0d0c
Add badge to readme.md for opening gitpod workspace
Mob-Programming-Meetup-Austria Jan 19, 2022
1d89992
trying out docker-compose template for gitpod
Mob-Programming-Meetup-Austria Jan 19, 2022
c89e1d7
configure ports
Mob-Programming-Meetup-Austria Jan 19, 2022
f979169
open perview
Mob-Programming-Meetup-Austria Jan 19, 2022
9b9841a
Initialize foodsoft containers
Mob-Programming-Meetup-Austria Jan 19, 2022
e30f3b6
tryout docker-compose up in init
Mob-Programming-Meetup-Austria Jan 19, 2022
a115857
instruction how to set up initial database added
Mob-Programming-Meetup-Austria Jan 19, 2022
4a79bf7
fix readme, remove obsolete code
Mob-Programming-Meetup-Austria Jan 19, 2022
a327256
Update comment
Mob-Programming-Meetup-Austria Jan 20, 2022
07ed016
Update README.md
Mob-Programming-Meetup-Austria Jan 20, 2022
9d7cd0c
Separate container preparation and start
haraldreingruber Jan 20, 2022
0e791a3
Only open main webinterface as preview, not mailcatcher nor phpmyadmin
haraldreingruber Jan 30, 2022
bcf3b39
Use ruby:2.6 as .gitpod.yml base image...
haraldreingruber Jan 30, 2022
7ac8fd9
Use gitpod base image, but ruby 2.6.9
haraldreingruber Jan 30, 2022
3088773
Install correct bundler and rake version...
haraldreingruber Jan 30, 2022
1088bb3
Install all dependencies also in the main gitpod container
haraldreingruber Jan 30, 2022
9601c37
Split up Rails and Docker init tasks
haraldreingruber Jan 30, 2022
9ab0f08
Update .gitpod.yml
haraldreingruber Jan 30, 2022
4c81737
Update .gitpod.yml
haraldreingruber Jan 30, 2022
a0ca9ae
Update .gitpod.yml
haraldreingruber Feb 7, 2022
ea738e5
Set new ruby version as default
haraldreingruber Feb 8, 2022
a341224
Switche init task order, so rails terminal will be open when done
haraldreingruber Feb 8, 2022
c8c4a24
extract gitpod steps into its own document
koushik-ms Jan 30, 2022
ffe8032
Update README.md
haraldreingruber Jan 30, 2022
cfe4e09
Update SETUP_GITPOD.md
haraldreingruber Jan 30, 2022
275a202
rename gitpod setup document
koushik-ms Jan 30, 2022
ead2a0e
Extract ruby installation into .gitpod.Dockerfile
haraldreingruber Feb 8, 2022
04c01fb
Use reinstall, to delete the old ruby version
haraldreingruber Feb 8, 2022
1b0fc43
Fix gitpod.Dockerfile permission errors
haraldreingruber Feb 8, 2022
bcbc54f
Fix .gitpod.Dockerfile ruby installation
haraldreingruber Feb 8, 2022
c414a83
Move ruby installation back to .gitpod.yml
haraldreingruber Feb 8, 2022
01687df
Check which user runs bundle install
haraldreingruber Feb 8, 2022
f3cb402
Fix link to SETUP_DEVELOPMENT_GITPOD.md
haraldreingruber Feb 8, 2022
fb04265
Fix ownership of tmp/cache folder
haraldreingruber Feb 8, 2022
4286e1d
Setup test database in gitpod.yml
haraldreingruber Feb 13, 2022
e7bb294
Open bash inside foodsoft container, instead of installing rails in t…
Mob-Programming-Meetup-Austria Mar 19, 2022
29bdd78
Fixes typos in echo message
haraldreingruber May 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This configuration file was mainly inspired by ./doc/SETUP_DEVELOPMENT_DOCKER.md
tasks:
- name: Docker
init: |
# init docker containers
docker-compose -f docker-compose-dev.yml pull
docker-compose -f docker-compose-dev.yml up -d mariadb
docker-compose -f docker-compose-dev.yml run --rm foodsoft bundle install
docker-compose -f docker-compose-dev.yml run --rm foodsoft bundle exec rake foodsoft:setup_development_docker
# setup test database
docker-compose -f docker-compose-dev.yml run --rm mariadb mariadb --host=mariadb --password=secret --execute="CREATE DATABASE test"
docker-compose -f docker-compose-dev.yml run --rm foodsoft bundle exec rake db:schema:load RAILS_ENV=test DATABASE_URL=mysql2://root:secret@mariadb/test?encoding=utf8mb4
command: |
# start docker containers
docker-compose -f docker-compose-dev.yml up

- name: Rails
command: |
echo "The rails application is started in docker containers (see docker-compose-dev.yml)."
echo "For executing rails commands, open up a bash terminal inside the foodsoft container via 'docker-compose -f docker-compose-dev.yml exec foodsoft bash'"

ports:
- port: 3000
onOpen: open-preview
- port: 2080
onOpen: notify
- port: 1080
onOpen: notify

vscode:
extensions:
- ms-azuretools.vscode-docker
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Get foodsoft [running locally](doc/SETUP_DEVELOPMENT.md),
then visit our [Developing Guidelines](https://github.com/foodcoops/foodsoft/wiki/Developing-Guidelines)
page on the wiki.

Get a foodsoft dev-environment running in the browser with Gitpod

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/mob-programming-meetup/foodsoft)

Follow these [instructions](doc/SETUP_DEVELOPMENT_GITPOD.md) to complete setup from within the Gitpod workspace.

Deploying
---------
Expand Down
17 changes: 17 additions & 0 deletions doc/SETUP_DEVELOPMENT_GITPOD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

After opening the workspace, follow these steps to complete the setup:

1. Login using the default credentials: `admin/secret`

1. Change the admin password, just in case.

1. Optionally, load an initial database (here seeded with `small.en`) by running

```
docker-compose -f docker-compose-dev.yml run --rm foodsoft \
bundle exec rake db:schema:load db:seed:small.en
```

> Note: The gitpod env is setup to open the front-ends using a preview browser built into the workspace. You can also open these in browser tabs by clicking the icon next to address bar. Refer gitpod.io docs about [whitelisting workspaces](https://www.gitpod.io/docs/configure/browser-settings#browser-settings) to prevent pop-up blockers from blocking these tabs.

The main configuration of the Gitpod workspace is in [/.gippod.yml](/.gitpod.yml). Check out https://www.gitpod.io/docs/config-gitpod-file for more information.