Skip to content

Commit

Permalink
Add sample launch.json file.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxp committed Feb 29, 2024
1 parent 78d195a commit 8399c71
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 20 deletions.
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -608,23 +608,7 @@ run-islandora-migrations:
.SILENT: solr-cores
solr-cores:
docker compose exec -T drupal with-contenv bash -lc "for_all_sites create_solr_core_with_default_config"
mkdir -p data
curl -k -L https://github.com/dbmdz/solr-ocrhighlighting/releases/download/0.8.4/solr-ocrhighlighting-0.8.4.jar > data/solr-ocrhighlighting.jar
docker-compose exec -T solr with-contenv bash -lc "mkdir -p /opt/solr/server/solr/contrib/ocrhighlighting/lib /opt/solr/server/solr/ISLANDORA/"
docker cp data/solr-ocrhighlighting.jar $$(docker-compose ps -q solr):/opt/solr/server/solr/contrib/ocrhighlighting/lib/solr-ocrhighlighting.jar
$(MAKE) solr-cores-lucene-highlighter
docker-compose exec -T solr with-contenv bash -lc "chown -R solr:solr /opt/solr/server/solr/contrib/ocrhighlighting"
docker-compose restart solr
sleep 10
docker-compose restart solr
sleep 10
docker-compose exec -T drupal with-contenv bash -lc "for_all_sites create_solr_core"

.PHONY: solr-cores-lucene-highlighter
.SILENT: solr-cores-lucene-highlighter
solr-cores-lucene-highlighter:
curl -k -L https://repo1.maven.org/maven2/org/apache/lucene/lucene-queries/9.4.0/lucene-queries-9.4.0.jar > data/lucene-queries-8.0.0.jar
docker cp data/lucene-queries-8.0.0.jar $$(docker-compose ps -q solr):/opt/solr/server/solr/contrib/ocrhighlighting/lib/lucene-queries-8.0.0.jar

.PHONY: namespaces
## Creates namespaces in Blazegraph according to the environment variables.
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ To enable using secrets prior to running the `make` commands, copy sample.env
to .env. Set `USE_SECRETS=true` in your .env file. Make a copy of the files in
/secrets/template/ to /secrets/live/.

To enable using secrets after run `make local` or `make up`, set
To enable using secrets after run `make local` or `make up`, set
`USE_SECRETS=true` in your .env file. When you run `make docker-compose.yml`, a
large block of `secrets` will be added at the top of your `docker-compose.yml`
file.
Expand Down Expand Up @@ -312,13 +312,24 @@ the following.

XDebug can be temporarily installed in the Drupal container via the 'make xdebug' command.

It uploads the contents of scripts/extra/xdebug.ini to the server.
The make xdebug command also uploads the contents of scripts/extra/xdebug.ini to the server.

This default configuration will automatically connect to the Docker host on every
This default configuration will automatically connect to the Docker host port 9003 on every
request. You may wish to customize this file to your preference.

When you run 'make down' and 'make up' again, XDebug will be gone.

### Sample launch.json file

For Visual Studio: Code users, there is a sample launch.json file in scripts/extras. Put this in
your project codebase's .vscode folder and you should be able to launch "Listen for XDebug" to have
your editor stop at breakpoints you set. Check that the relative paths
correspond to your codebase, the file assumes
it sits in the root of an ISLE-DC project folder.

The file also contains a "Launch Chrome" debug profile
which lets you set breakpoints in JavaScript code.

### Watchtower

The [watchtower](https://hub.docker.com/r/v2tec/watchtower/) container monitors
Expand Down Expand Up @@ -397,7 +408,7 @@ lowercasename:
echo "first line in command needs to be indented. There are exceptions to this, review functions in the Makefile for examples of these exceptions."
```

NOTE: A target you add in the custom.Makefile will not override an existing target with the same label in this repository's defautl Makefile.
NOTE: A target you add in the custom.Makefile will not override an existing target with the same label in this repository's defautl Makefile.

Running the new `custom.Makefile` commands are exactly the same as running any other Makefile command. Just run `make` and the function's name.
```bash
Expand Down
58 changes: 58 additions & 0 deletions scripts/extra/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "https://islandora.traefik.me",
"webRoot": "${workspaceFolder}/codebase/web"
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/drupal": "${workspaceRoot}/codebase",
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://islandora.traefik.me:([0-9]+)\\) started",
"uriFormat": "http://islandora.traefik.me:%s",
"action": "openExternally"
}
}
]
}

0 comments on commit 8399c71

Please sign in to comment.