Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Losoponkul committed Jun 8, 2023
1 parent 1463b23 commit efbfd24
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 75 deletions.
3 changes: 1 addition & 2 deletions infrastructure/dev/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

REPO_HOME="${SCRIPT_DIR}/../.."

Expand All @@ -12,4 +12,3 @@ echo "--------------------------------------"

cd ${REPO_HOME}
sbt "clean; docker:publishLocal"

4 changes: 2 additions & 2 deletions infrastructure/dev/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

# Set working directory
cd ${SCRIPT_DIR}
cd ../../
sbt "clean;cleanFiles"
sbt "clean;cleanFiles"
2 changes: 1 addition & 1 deletion infrastructure/dev/get-versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

# Set working directory
cd ${SCRIPT_DIR}
Expand Down
112 changes: 55 additions & 57 deletions infrastructure/dev/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,76 @@

set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

# Set working directory
cd ${SCRIPT_DIR}

source get-versions.sh
export VAULT_DEV_ROOT_TOKEN_ID="root"

Help()
{
# Display Help
echo "Run an instance of the ATALA bulding-block stack locally"
echo
echo "Syntax: run.sh [-n/--name NAME|-p/--port PORT|-b/--background|-w/--wait|--debug|-h/--help]"
echo "options:"
echo "-n/--name Name of this instance - defaults to dev."
echo "-p/--port Port to run this instance on - defaults to 80."
echo "-b/--background Run in docker-compose daemon mode in the background."
echo "-w/--wait Wait until all containers are healthy (only in the background)."
echo "--debug Run additional services for debug using docker-compose debug profile."
echo "-h/--help Print this help text."
echo
Help() {
# Display Help
echo "Run an instance of the ATALA bulding-block stack locally"
echo
echo "Syntax: run.sh [-n/--name NAME|-p/--port PORT|-b/--background|-w/--wait|--debug|-h/--help]"
echo "options:"
echo "-n/--name Name of this instance - defaults to dev."
echo "-p/--port Port to run this instance on - defaults to 80."
echo "-b/--background Run in docker-compose daemon mode in the background."
echo "-w/--wait Wait until all containers are healthy (only in the background)."
echo "--debug Run additional services for debug using docker-compose debug profile."
echo "-h/--help Print this help text."
echo
}

POSITIONAL_ARGS=()

while [[ $# -gt 0 ]]; do
case $1 in
-n|--name)
NAME="$2"
shift # past argument
shift # past value
;;
-p|--port)
PORT="$2"
shift # past argument
shift # past value
;;
-b|--background)
BACKGROUND="-d"
shift # past argument
;;
-w|--wait)
WAIT="--wait"
shift # past argument
;;
-h|--help)
Help
exit
;;
--debug)
DEBUG="--profile debug"
shift # past argument
;;
-*|--*)
echo "Unknown option $1"
Help
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
case $1 in
-n | --name)
NAME="$2"
shift # past argument
shift # past value
;;
-p | --port)
PORT="$2"
shift # past argument
shift # past value
;;
-b | --background)
BACKGROUND="-d"
shift # past argument
;;
-w | --wait)
WAIT="--wait"
shift # past argument
;;
-h | --help)
Help
exit
;;
--debug)
DEBUG="--profile debug"
shift # past argument
;;
-* | --*)
echo "Unknown option $1"
Help
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done

set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters


if [[ -n $1 ]]; then
echo "Last line of file specified as non-opt/last argument:"
tail -1 "$1"
echo "Last line of file specified as non-opt/last argument:"
tail -1 "$1"
fi

NAME="${NAME:=dev}"
Expand All @@ -87,5 +85,5 @@ echo "Starting stack using docker compose"
echo "--------------------------------------"

PORT=${PORT} docker compose \
-p ${NAME} \
-f ${SCRIPT_DIR}/../shared/docker-compose.yml ${DEBUG} up ${BACKGROUND} ${WAIT}
-p ${NAME} \
-f ${SCRIPT_DIR}/../shared/docker-compose.yml ${DEBUG} up ${BACKGROUND} ${WAIT}
7 changes: 5 additions & 2 deletions infrastructure/multi/run-e2e-tests-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)

echo "--------------------------------------"
echo "Starting issuer using local/run.sh"
Expand All @@ -26,4 +26,7 @@ echo "--------------------------------------"
echo "Run e2e tests"
echo "--------------------------------------"

(cd ${SCRIPT_DIR}/../../tests/e2e-tests/; ./gradlew test reports)
(
cd ${SCRIPT_DIR}/../../tests/e2e-tests/
./gradlew test reports
)
20 changes: 9 additions & 11 deletions infrastructure/shared/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ services:
- pg_data_db:/var/lib/postgresql/data
- ./postgres/init-script.sh:/docker-entrypoint-initdb.d/init-script.sh
- ./postgres/max_conns.sql:/docker-entrypoint-initdb.d/max_conns.sql
# ports:
# - "5432:5432"
# ports:
# - "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres", "-d", "iris" ]
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "iris"]
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -53,21 +53,20 @@ services:

vault-server:
image: vault:latest
# ports:
# - "8200:8200"
# ports:
# - "8200:8200"
environment:
VAULT_ADDR: "http://0.0.0.0:8200"
VAULT_DEV_ROOT_TOKEN_ID: ${VAULT_DEV_ROOT_TOKEN_ID}
command: server -dev -dev-root-token-id=${VAULT_DEV_ROOT_TOKEN_ID}
cap_add:
- IPC_LOCK
healthcheck:
test: [ "CMD", "vault", "status" ]
test: ["CMD", "vault", "status"]
interval: 10s
timeout: 5s
retries: 5


prism-agent:
image: ghcr.io/input-output-hk/prism-agent:${PRISM_AGENT_VERSION}
environment:
Expand Down Expand Up @@ -106,14 +105,14 @@ services:
vault-server:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://prism-agent:8085/connections" ]
test: ["CMD", "curl", "-f", "http://prism-agent:8085/connections"]
interval: 30s
timeout: 10s
retries: 5
extra_hosts:
- "host.docker.internal:host-gateway"
# ports:
# - "8085:8085"
# ports:
# - "8085:8085"

swagger-ui:
image: swaggerapi/swagger-ui:v4.14.0
Expand All @@ -137,7 +136,6 @@ services:
volumes:
pg_data_db:
pgadmin:

# Temporary commit network setting due to e2e CI bug
# to be enabled later after debugging
#networks:
Expand Down

0 comments on commit efbfd24

Please sign in to comment.