Replace Makefile with workspace
This commit is contained in:
parent
bb5572dfd5
commit
177e19f7d2
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,3 +11,4 @@
|
|||
!/patches/
|
||||
!/README.md
|
||||
!/tools/
|
||||
!/workspace.yml
|
||||
|
|
23
Makefile
23
Makefile
|
@ -1,23 +0,0 @@
|
|||
default: init
|
||||
|
||||
app-install: copy-required-files
|
||||
docker-compose run --rm php vendor/bin/drush site:install -y \
|
||||
--existing-config \
|
||||
--site-name="Stream Demo" \
|
||||
--account-pass=admin123
|
||||
|
||||
copy-required-files: vendor
|
||||
cp .env.example .env
|
||||
cp .docker.env.example .docker.env
|
||||
|
||||
init: copy-required-files start app-install
|
||||
|
||||
start: copy-required-files
|
||||
docker-compose up -d
|
||||
|
||||
stop:
|
||||
docker-compose down --remove-orphans
|
||||
|
||||
vendor: composer.json composer.lock
|
||||
docker-compose run --rm composer validate
|
||||
docker-compose run --rm composer install
|
22
README.md
22
README.md
|
@ -23,38 +23,32 @@ Using Drupal's Composer Scaffold
|
|||
|
||||
### Starting the project
|
||||
|
||||
The project is using Docker and Docker Compose for local development.
|
||||
The project is using Docker, Docker Compose and [Workspace](https://github.com/my127/workspace) for local development.
|
||||
|
||||
Run the `make` command to create the required files, download Drupal core, the additional contrib modules and PHP libraries, and install Drupal.
|
||||
Once Workspace is installed, run `ws install` to create the required files, download Drupal core, the additional contrib modules and PHP libraries, and install Drupal.
|
||||
|
||||
If you are using [Traefik](https://docs.traefik.io) (recommended), then the site should now be available at <http://stream-demo.docker.localhost>.
|
||||
|
||||
### Running Composer commands
|
||||
|
||||
Compser commands can be run via the `docker-compose run` command:
|
||||
Compser commands can be run via the `ws composer` command:
|
||||
|
||||
```
|
||||
docker-compose run --rm composer <command>
|
||||
ws composer <command>
|
||||
```
|
||||
|
||||
For example, to add the Admin Toolbar module:
|
||||
|
||||
```
|
||||
docker-compose run --rm composer require drupal/admin_toolbar
|
||||
ws composer require drupal/admin_toolbar
|
||||
```
|
||||
|
||||
### Running Drush commands
|
||||
|
||||
Drush commands can be run via the `docker-compose run` command:
|
||||
Drush commands can be run via the `ws drush` command. For example, to rebuild the cache:
|
||||
|
||||
```
|
||||
docker-compose run --rm php vendor/bin/drush <command>
|
||||
ws drush cache:rebuild
|
||||
```
|
||||
|
||||
For example, to rebuild the cache:
|
||||
|
||||
```
|
||||
docker-compose run --rm php vendor/bin/drush cache:rebuild
|
||||
```
|
||||
|
||||
Alternatively, you could connect to the `php` container using `docker-compose exec php` and run `vendor/bin/drush <command>` within the container.
|
||||
Alternatively, you could connect to the `php` container using `ws console` and run `vendor/bin/drush <command>` within the container.
|
||||
|
|
|
@ -28,6 +28,8 @@ services:
|
|||
- .:/srv/app
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- DRUSH_OPTIONS_URI
|
||||
links:
|
||||
- mysql
|
||||
networks:
|
||||
|
|
41
workspace.yml
Normal file
41
workspace.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
command('composer %'): |
|
||||
#!bash|=
|
||||
passthru "docker-compose run --rm composer ={ input.argument('%') }"
|
||||
|
||||
command('console'): |
|
||||
#!bash
|
||||
passthru "docker-compose run --rm php bash"
|
||||
|
||||
command('disable'): |
|
||||
#!bash
|
||||
run "docker-compose down --remove-orphans"
|
||||
|
||||
command('destroy'): |
|
||||
#!bash
|
||||
run "docker-compose down --remove-orphans -v"
|
||||
|
||||
command('drush %'):
|
||||
env:
|
||||
DRUSH_OPTIONS_URI: = @('app.url')
|
||||
exec: |
|
||||
#!bash|=
|
||||
passthru "docker-compose run --rm php vendor/bin/drush ={ input.argument('%') }"
|
||||
|
||||
command('enable'): |
|
||||
#!bash
|
||||
run "docker-compose up -d"
|
||||
|
||||
command('install'): |
|
||||
#!bash|@
|
||||
run "cp .docker.env.example .docker.env"
|
||||
run "cp .env.example .env"
|
||||
run "ws composer validate"
|
||||
run "ws composer install"
|
||||
run "ws enable"
|
||||
run "ws drush site:install -y --existing-config --account-pass=@('admin.password')"
|
||||
|
||||
attributes:
|
||||
admin:
|
||||
password: secret
|
||||
app:
|
||||
url: http://stream-demo.docker.localhost
|
Reference in a new issue