Skip to content

Commit

Permalink
Move Compose files and scripts to dev directory
Browse files Browse the repository at this point in the history
To make it clear that these Compose files are only meant for dev and testing work. Avoiding confusion with the existing `src/main/docker/docker-compose.yml`, which is also used as quickstart.

Signed-off-by: nscuro <nscuro@protonmail.com>
  • Loading branch information
nscuro committed May 29, 2023
1 parent 0dc6a68 commit df196b5
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 11 deletions.
24 changes: 15 additions & 9 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ mirrored the NVD data, so there's no need to re-download it again.
Prior to starting Dependency-Track, execute the `data-nist-generate-dummy.sh` script:

```shell
./scripts/data-nist-generate-dummy.sh
./dev/scripts/data-nist-generate-dummy.sh
```

> **Note**
Expand All @@ -175,7 +175,7 @@ When testing containerized deployments, simply mount the local directory contain
NVD data into the container:

```shell
./scripts/data-nist-generate-dummy.sh
./dev/scripts/data-nist-generate-dummy.sh
docker run -d --name dtrack \
-v "$HOME/.dependency-track:/data/.dependency-track" \
-p '127.0.0.1:8080:8080' dependencytrack/apiserver:snapshot
Expand Down Expand Up @@ -216,38 +216,44 @@ starting single tests separately via IDE is a better choice.

### Testing manually

We provide multiple Docker Compose files that can be used to quickly set up a local testing environment.
We provide multiple Docker Compose files that can be used to quickly set up a local testing environment.
The files are located in the [`dev`](dev/) directory.

#### With embedded H2 database

The default `docker-compose.yml` will deploy a frontend and API server container using an embedded H2 database.
The default [`docker-compose.yml`](dev/docker-compose.yml) will deploy a frontend and API server container using an
embedded H2 database.

```shell
cd dev
docker compose up -d
```

#### With PostgreSQL database

To use a PostgreSQL database instead of embedded H2, use `docker-compose.postgres.yml`.
To use a PostgreSQL database instead of embedded H2, use [`docker-compose.postgres.yml`](dev/docker-compose.postgres.yml).

```shell
cd dev
docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -d
```

#### With Microsoft SQL Server database

To use a Microsoft SQL Server database instead of embedded H2, use `docker-compose.mssql.yml`.
To use a Microsoft SQL Server database instead of embedded H2, use [`docker-compose.mssql.yml`](dev/docker-compose.mssql.yml).

```shell
cd dev
docker compose -f docker-compose.yml -f docker-compose.mssql.yml up -d
```

#### With monitoring stack

To deploy both Prometheus and Grafana, `docker-compose.monitoring.yml` may be supplied to any
To deploy both Prometheus and Grafana, [`docker-compose.monitoring.yml`](dev/docker-compose.monitoring.yml) may be supplied to any
of the commands listed above. For example:

```shell
cd dev
docker compose -f docker-compose.yml -f docker-compose.postgres.yml -f docker-compose.monitoring.yml up -d
```

Expand Down Expand Up @@ -311,15 +317,15 @@ There is a lot going on in `docs`, but most of the time you'll want to spend you
To build the docs, run:

```shell
./scripts/docs-build.sh
./dev/scripts/docs-build.sh
```

This installs all required dependencies (among them Jekyll) to `docs/vendor/bundle`, generates the documentation
website and stores it in `docs/_site`.

For local development, you may want to run this instead:
```shell
./scripts/docs-dev.sh
./dev/scripts/docs-dev.sh
```

This will start a local webserver that listens on `127.0.0.1:4000` and rebuilds the site whenever you make changes.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions docker-compose.yml → dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Steve Springett. All Rights Reserved.
name: "dependency-track"

services:
apiserver:
image: dependencytrack/apiserver:snapshot
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

DEFAULT_OUTPUT="./schema.sql"
DEFAULT_DNPROPS="./scripts/dbschema-generate.datanucleus.properties"
DEFAULT_DNPROPS="./dev/scripts/dbschema-generate.datanucleus.properties"

function printHelp() {
echo "Generate the database schema for Dependency-Track."
Expand Down Expand Up @@ -40,4 +40,4 @@ mvn datanucleus:schema-create \
-Dprops="${dnprops:-$DEFAULT_DNPROPS}" \
-DcompleteDdl=true \
-DddlFile="${output:-$DEFAULT_OUTPUT}" \
-Dlog4jConfiguration=./scripts/dbschema-generate.log4j.properties
-Dlog4jConfiguration=./dev/scripts/dbschema-generate.log4j.properties
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit df196b5

Please sign in to comment.