Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shaal/ng-ddev-gitpod


https://github.com/shaal/ng-ddev-gitpod

Last synced: 13 days ago
JSON representation

Awesome Lists containing this project

README

        

[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/shaal/ddev-gitpod)

# ddev + Gitpod
## Set up a full Drupal dev environment in a browser

This project demonstrates a complete Drupal 9 development environment, utilizing ddev and Gitpod, through your browser.

## Video Demo

Watch a 5 minutes walkthrough video:

Setup a full Drupal dev environment in a browser

## Prerequisites:
1. [Sign up for gitpod.io](https://gitpod.io/login)
1. Check [Enable Feature Preview](https://gitpod.io/settings) (To allow running docker inside docker)

## Try it out:
1. Click on the following link
https://gitpod.io/#https://github.com/shaal/ddev-gitpod
1. Your environment is being prepared, wait for about 40 seconds (A splash screen will appear with a 3d Gitpod cube)
1. Theia (or VScode) IDE will be displayed.
1. Note that one terminal is running `sudo docker-up`, and another terminal in parallel is running `ddev start`
1. ddev will pull all required Docker images.
1. Find your website's URL `gp url 8080`
1. Open your website's URL in a browser, you should see Drupal's installation screen.
1. Run in terminal `ddev drush si demo_umami -y`
1. Open your website's URL in a browser, you should see Drupal's Umami demo.
1. Run in terminal `ddev xdebug on`
1. Open VScode's debugger, place a new breakpoint in `web/index.php`
1. Open your website's URL in a browser.
1. :tada:

## Do you like PhpStorm instead of Theia or VScode?

1. Open a bash window at the bottom
2. `.ddev/run-phpstorm.sh`
3. When it shows you port 9999 is up, click the link and use PhpStorm with this repo.

## How does it work?
1. Gitpod - development environment based on Docker
1. [.gitpod.yml](https://github.com/shaal/ddev-gitpod/blob/main/.gitpod.yml)
1. Defines the main docker image this environment is built on - `.gitpod.Dockerfile`
1. Run initial commands using 3 terminals in parallel:
1. `gitpod-setup-ddev.sh`
1. `composer install`
1. `sudo docker-up`
1. [.gitpod.Dockerfile](https://github.com/shaal/ddev-gitpod/blob/main/.gitpod.Dockerfile)
1. Set base image to Gitpod's `workspace-full` ([link](https://github.com/gitpod-io/workspace-images/tree/master/full))
1. Install ddev using brew
1. ddev - ridiculously simple setup for complex development environments
1. [.ddev/config.yaml](https://github.com/shaal/ddev-gitpod/blob/main/.ddev/config.yaml) - main ddev (default) configuration, can be generated by running `ddev config`
1. [.ddev/gitpod-setup-ddev.sh](https://github.com/shaal/ddev-gitpod/blob/main/.ddev/gitpod-setup-ddev.sh) - generate config overrides for ddev to work in the Gitpod environment.
1. Delete any existing Docker images and containers (due to Gitpod bug, that cause issues when restarting a workspace)
1. Set certain ports to public, following Gitpod's syntax `[port]-[workspace-url]`
1. `8080` - Drupal Website
1. `8025` - Mailhog
1. `8036` - PHPmyadmin
1. Set `host.docker.internal` with the correct value of gitpod's host ip
1. Starts ddev

## Thank you
[@rfay](https://github.com/rfay) for your endless patience and relentless support that made this project possible.

### Known issues:
* Once these Gitpod issues get resolved, starting a workspace will happen much faster:
* ~~[#2428 - `sudo docker-up` cannot run during prebuild](https://github.com/gitpod-io/gitpod/issues/2428)~~
* [#3174 - Permissions in docker images are lost during gitpod restore](https://github.com/gitpod-io/gitpod/issues/3174)

### Future:
* [Figure out storage solutions](https://www.gitpod.io/docs/self-hosted/latest/install/storage)