Skip to content

Commit

Permalink
DOC-1417 : moved command docker-compose to docker compose and removed…
Browse files Browse the repository at this point in the history
… version (#208)

* DOC-1417 : moved command docker-compose to docker compose and removed version

* DOC-1417 : updated service version
  • Loading branch information
HarshEviden authored Sep 5, 2024
1 parent cdd23ce commit 5dee215
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ or Helm [values file](./helm/ffc-pay-responses/values.yaml) if running Kubernete
Docker Compose can be used to build the container image.

```
docker-compose build
docker compose build
```

The service will file watch application and test files so no need to rebuild the container unless a change to an npm package is made.
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.acceptance.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
ffc-pay-processing:
build:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.debug.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
ffc-pay-processing:
command: npm run start:debug
1 change: 0 additions & 1 deletion docker-compose.link.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
networks:
default:
external:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.migrate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

x-common-migration: &common-migration
POSTGRES_HOST: ${POSTGRES_HOST:-ffc-pay-processing-postgres}
SCHEMA_ROLE: ${POSTGRES_SCHEMA_ROLE:-postgres}
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.override.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

# This override file should be used when running this service in isolation
# to provide dependencies and expose ports for local testing

Expand Down
1 change: 0 additions & 1 deletion docker-compose.test.debug.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
ffc-pay-processing:
command: npm run test:debug
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.test.watch.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
ffc-pay-processing:
command: >
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

# This override file should be used when running automated tests so
# that test output is saved to the host

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
ffc-pay-processing:
build:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffc-pay-processing",
"version": "2.55.22",
"version": "2.55.23",
"description": "Payment Hub processing service",
"homepage": "https://github.com/DEFRA/ffc-pay-processing",
"main": "app/index.js",
Expand Down
14 changes: 7 additions & 7 deletions scripts/acceptance
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ cd "${projectRoot}"
mkdir -p test-output

# Guarantee clean environment
docker-compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" down -v
docker-compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-test-runner" down -v
docker compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" down -v
docker compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-test-runner" down -v

# Ensure container images are up to date
docker-compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-acceptance-test" build
docker-compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" run --rm database-up
docker compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-acceptance-test" build
docker compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" run --rm database-up

echo "============================================"
echo "Running Pay Processing Acceptance Test(s)"
echo "============================================"
# Start container and run tests
docker-compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-acceptance-test" run --rm "${service}-test-runner" ${command}
docker compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-acceptance-test" run --rm "${service}-test-runner" ${command}

echo "============================================"
echo "Tear down environment"
echo "============================================"
# Tear down environment
docker-compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" down -v
docker-compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-test-runner" down -v
docker compose -f docker-compose.yaml -f docker-compose.migrate.yaml -p "${service}-acceptance-test" down -v
docker compose -f docker-compose.yaml -f docker-compose.acceptance.yaml -p "${service}-test-runner" down -v
8 changes: 4 additions & 4 deletions scripts/start
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ projectRoot="$(a="/$0"; a=${a%/*}; a=${a:-.}; a=${a#/}/; cd "$a/.." || return; p

cd "${projectRoot}"

docker-compose down
docker-compose -f docker-compose.migrate.yaml down
docker compose down
docker compose -f docker-compose.migrate.yaml down
# Ensure container images are up to date
docker-compose -f docker-compose.migrate.yaml run --rm database-up
docker compose -f docker-compose.migrate.yaml run --rm database-up

docker-compose \
docker compose \
-f docker-compose.yaml \
-f docker-compose.override.yaml \
-f docker-compose.link.yaml \
Expand Down
10 changes: 5 additions & 5 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ done

compose() {
if [ "${watch}" = "true" ]; then
docker-compose -f docker-compose.yaml -f docker-compose.test.yaml -f docker-compose.test.watch.yaml -p "${service}-test" $@
docker compose -f docker-compose.yaml -f docker-compose.test.yaml -f docker-compose.test.watch.yaml -p "${service}-test" $@
elif [ "${debug}" = "true" ]; then
docker-compose -f docker-compose.yaml -f docker-compose.test.yaml -f docker-compose.test.watch.yaml -f docker-compose.test.debug.yaml -p "${service}-test" $@
docker compose -f docker-compose.yaml -f docker-compose.test.yaml -f docker-compose.test.watch.yaml -f docker-compose.test.debug.yaml -p "${service}-test" $@
else
docker-compose -f docker-compose.yaml -f docker-compose.test.yaml -p "${service}-test" $@
docker compose -f docker-compose.yaml -f docker-compose.test.yaml -p "${service}-test" $@
fi
}

Expand All @@ -56,11 +56,11 @@ compose() {

# Guarantee clean environment
compose down -v
docker-compose -f docker-compose.migrate.yaml -p "${service}-test" down -v
docker compose -f docker-compose.migrate.yaml -p "${service}-test" down -v

# Ensure container images are up to date
compose build
docker-compose -f docker-compose.migrate.yaml -p "${service}-test" run --rm database-up
docker compose -f docker-compose.migrate.yaml -p "${service}-test" run --rm database-up

# Run tests
if [ "${debug}" = "true" ]; then
Expand Down

0 comments on commit 5dee215

Please sign in to comment.