Skip to content

Commit

Permalink
Merge pull request #14 from compliance-framework/imiell/compose-command
Browse files Browse the repository at this point in the history
Whitespace and make podman command override-able
  • Loading branch information
ianmiell authored Dec 21, 2024
2 parents e5136b9 + 5f4ed91 commit 21da5ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions hack/local-chris/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Chris's local

This script makes it easier for Chris to work with local compose files. Use it to your hearts content.
This script makes it easier for Chris to work with local compose files. Use it to your hearts content.

```shell
# Run all of the services. Nats + Mongo + API + Local SSH Agent
./hack/local-chris/do start_all

# Start API. No agents. Useful when developing agents.
# Start API. No agents. Useful when developing agents.
./hack/local-chris/do start_api

# Start Agents. No API. Useful when working on the API.
# Start Agents. No API. Useful when working on the API.
./hack/local-chris/do start_agents

# Run compose commands like exec or logs
# Run compose commands like exec or logs
./hack/local-chris/do logs configuration-service

# Stop all running services
Expand Down
11 changes: 6 additions & 5 deletions hack/local-chris/do
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# !/bin/bash

COMPOSE_COMMAND="${COMPOSE_COMMAND:-podman-compose}"

start_all() {
podman-compose -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml up -d
${COMPOSE_COMMAND} -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml up -d
}

stop() {
podman-compose -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml down
${COMPOSE_COMMAND} -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml down
}

start_api() {
podman-compose -f compose/common.yml -f compose/api.yml up -d
${COMPOSE_COMMAND} -f compose/common.yml -f compose/api.yml up -d
}

start_agents() {
podman-compose -f compose/common.yml -f compose/agent-local-ssh.yml up -d
${COMPOSE_COMMAND} -f compose/common.yml -f compose/agent-local-ssh.yml up -d
}

# Run is the default function. No need to call it's name.
run() {
podman-compose -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml $@
${COMPOSE_COMMAND} -f compose/common.yml -f compose/api.yml -f compose/agent-local-ssh.yml $@
}

# Check if the function exists
Expand Down

0 comments on commit 21da5ec

Please sign in to comment.