Commit e9b1c334 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Changes to centralice information on variables.sh file

parent 225caba9
Loading
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

export CAPIF_PRIV_KEY=
export CAPIF_PRIV_KEY_BASE_64=
export MONITORING=
export LOG_LEVEL=DEBUG

running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")"
services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-vault.yml ps --services --all)"
running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all --filter "status=running")"
services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME docker compose -f docker-compose-vault.yml ps --services --all)"
if [ "$running" != "$services" ]; then
    echo "Following Vault services are not running:"
    # Bash specific
@@ -15,8 +15,8 @@ else
    echo "All Vault services are running"
fi

running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")"
services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)"
running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all --filter "status=running")"
services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_HOSTNAME=$CAPIF_HOSTNAME MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-capif.yml ps --services --all)"
if [ "$running" != "$services" ]; then
    echo "Following CCF services are not running:"
    # Bash specific
@@ -26,8 +26,8 @@ else
    echo "All CCF services are running"
fi

running="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")"
services="$(LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)"
running="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all --filter "status=running")"
services="$(GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f docker-compose-register.yml ps --services --all)"
if [ "$running" != "$services" ]; then
    echo "Following Register services are not running:"
    # Bash specific
+5 −8
Original line number Diff line number Diff line
#!/bin/bash

# Directories variables setup (no modification needed)
export SERVICES_DIR=$(dirname "$(readlink -f "$0")")
export CAPIF_BASE_DIR=$(dirname "$SERVICES_DIR")
# Path to the register config.yaml file
REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml"
source $(dirname "$(readlink -f "$0")")/variables.sh

help() {
  echo "Usage: $1 <options>"
@@ -28,7 +23,7 @@ FILES=()
echo "${FILES[@]}"

# Read params
while getopts "cvrahms" opt; do
while getopts "cvrahmsf:" opt; do
  case $opt in
    c)
      echo "Remove Capif services"
@@ -74,7 +69,7 @@ echo "${FILES[@]}"

for FILE in "${FILES[@]}"; do
  echo "Executing 'docker compose down' for file $FILE"
  CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down --rmi all
  GITLAB_BASE_URL=$GITLAB_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 DUID=$DUID DGID=$DGID MONITORING=$MONITORING_STATE LOG_LEVEL=$LOG_LEVEL docker compose -f "$FILE" down --rmi all
  status=$?
    if [ $status -eq 0 ]; then
        echo "*** Removed Service from $FILE ***"
@@ -83,6 +78,8 @@ for FILE in "${FILES[@]}"; do
    fi
done

# Path to the register config.yaml file
REGISTER_CONFIG_FILE="$SERVICES_DIR/register/config.yaml"
# Check if the backup config.yaml file exists before restoring
if [ -f "$REGISTER_CONFIG_FILE.bak" ]; then
  git update-index --no-assume-unchanged "$REGISTER_CONFIG_FILE.bak"
+1 −2
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

# Directories variables setup (no modification needed)
export SERVICES_DIR=$(dirname "$(readlink -f "$0")")

FILE="$SERVICES_DIR/docker-compose-mock-server.yml"

echo "Executing 'docker compose down' for file $FILE"
+1 −24
Original line number Diff line number Diff line
#!/bin/bash
source $(dirname "$(readlink -f "$0")")/variables.sh

# User to create
TOTAL_USERS=1
@@ -58,30 +59,6 @@ then
    exit -1
fi

# Other Stuff
DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image
DOCKER_ROBOT_IMAGE_VERSION=1.0
cd ..
REPOSITORY_BASE_FOLDER=${PWD}
TEST_FOLDER=$REPOSITORY_BASE_FOLDER/tests
RESULT_FOLDER=$REPOSITORY_BASE_FOLDER/results
ROBOT_DOCKER_FILE_FOLDER=$REPOSITORY_BASE_FOLDER/tools/robot

# nginx Hostname and http port (80 by default) to reach for tests
CAPIF_REGISTER=capifcore
CAPIF_REGISTER_PORT=8084
CAPIF_HOSTNAME=capifcore
CAPIF_HTTP_PORT=8080
CAPIF_HTTPS_PORT=443

# VAULT access configuration
CAPIF_VAULT=vault
CAPIF_VAULT_PORT=8200
CAPIF_VAULT_TOKEN=read-ca-token

# Mock Server
MOCK_SERVER_URL=http://mock-server:9100
NOTIFICATION_DESTINATION_URL=$MOCK_SERVER_URL

PLATFORM=$(uname -m)
if [ "x86_64" == "$PLATFORM" ]; then
+37 −37
Original line number Diff line number Diff line
@@ -5,21 +5,21 @@ services:
    ports:
      - "6379:6379"
    volumes:
      - $PWD/redis-data:/var/lib/redis
      - $PWD/redis.conf:/usr/local/etc/redis/redis.conf
      - ${SERVICES_DIR}/redis-data:/var/lib/redis
      - ${SERVICES_DIR}/redis.conf:/usr/local/etc/redis/redis.conf
    environment:
      - REDIS_REPLICATION_MODE=master
    

  helper:
    build:
      context: ./helper
      context: ${SERVICES_DIR}/helper
    expose:
      - "8080"
    container_name: helper
    restart: unless-stopped
    volumes:
      - ./helper:/usr/src/app
      - ${SERVICES_DIR}/helper:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -32,17 +32,17 @@ services:
      - VAULT_ACCESS_TOKEN=dev-only-token
      - VAULT_PORT=8200
      - LOG_LEVEL=${LOG_LEVEL}
    image: labs.etsi.org:5050/ocf/capif/helper:v2.x.x-release
    image: ${GITLAB_BASE_URL}/helper:${OCF_VERSION}
    depends_on:
      - nginx

  access-control-policy:
    build:
      context: ./TS29222_CAPIF_Access_Control_Policy_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Access_Control_Policy_API:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -53,18 +53,18 @@ services:
      - MONITORING=${MONITORING}
      - LOG_LEVEL=${LOG_LEVEL}
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/access-control-policy:v2.x.x-release
    image: ${GITLAB_BASE_URL}/access-control-policy:${OCF_VERSION}
    depends_on:
      - redis
      - nginx

  api-invoker-management:
    build:
      context: ./TS29222_CAPIF_API_Invoker_Management_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_API_Invoker_Management_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_API_Invoker_Management_API:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -79,24 +79,24 @@ services:
      - VAULT_PORT=8200
      - LOG_LEVEL=${LOG_LEVEL}
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/api-invoker-management-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/api-invoker-management-api:${OCF_VERSION}
    depends_on:
    - redis
    - nginx

  api-provider-management:
    build:
      context: ./TS29222_CAPIF_API_Provider_Management_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_API_Provider_Management_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_API_Provider_Management_API:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
      - otel-collector:host-gateway
      - vault:host-gateway
    image: labs.etsi.org:5050/ocf/capif/api-provider-management-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/api-provider-management-api:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - CONTAINER_NAME=api-provider-management
@@ -111,17 +111,17 @@ services:

  logs:
    build:
      context: ./TS29222_CAPIF_Auditing_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Auditing_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Auditing_API:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
      - otel-collector:host-gateway
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/auditing-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/auditing-api:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - CONTAINER_NAME=api-auditing
@@ -132,17 +132,17 @@ services:

  service-apis:
    build:
      context: ./TS29222_CAPIF_Discover_Service_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Discover_Service_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Discover_Service_API:/usr/src/app
    restart: unless-stopped
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
      - otel-collector:host-gateway
    image: labs.etsi.org:5050/ocf/capif/discover-service-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/discover-service-api:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - CONTAINER_NAME=services-apis
@@ -153,12 +153,12 @@ services:

  capif-events:
    build:
      context: ./TS29222_CAPIF_Events_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Events_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Events_API:/usr/src/app
    image: labs.etsi.org:5050/ocf/capif/events-api:v2.x.x-release
      - ${SERVICES_DIR}/TS29222_CAPIF_Events_API:/usr/src/app
    image: ${GITLAB_BASE_URL}/events-api:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - CONTAINER_NAME=api-events
@@ -175,13 +175,13 @@ services:

  api-invocation-logs:
    build:
      context: ./TS29222_CAPIF_Logging_API_Invocation_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Logging_API_Invocation_API:/usr/src/app
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/api-invocation-logs-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/api-invocation-logs-api:${OCF_VERSION}
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -196,13 +196,13 @@ services:

  published-apis:
    build:
      context: ./TS29222_CAPIF_Publish_Service_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Publish_Service_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Publish_Service_API:/usr/src/app
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/publish-service-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/publish-service-api:${OCF_VERSION}
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -218,20 +218,20 @@ services:

  capif-routing-info:
    build:
      context: ./TS29222_CAPIF_Routing_Info_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Routing_Info_API
    expose:
      - "8080"
    image: labs.etsi.org:5050/ocf/capif/routing-info-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/routing-info-api:${OCF_VERSION}

  capif-security:
    build:
      context: ./TS29222_CAPIF_Security_API
      context: ${SERVICES_DIR}/TS29222_CAPIF_Security_API
    expose:
      - "8080"
    volumes:
      - ./TS29222_CAPIF_Security_API:/usr/src/app
      - ${SERVICES_DIR}/TS29222_CAPIF_Security_API:/usr/src/app
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/security-api:v2.x.x-release
    image: ${GITLAB_BASE_URL}/security-api:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - CONTAINER_NAME=api-security
@@ -278,11 +278,11 @@ services:

  nginx:
    build:
      context: ./nginx
      context: ${SERVICES_DIR}/nginx
    ports:
      - "8080:8080"
      - "443:443"
    image: labs.etsi.org:5050/ocf/capif/nginx:v2.x.x-release
    image: ${GITLAB_BASE_URL}/nginx:${OCF_VERSION}
    environment:
      - CAPIF_HOSTNAME=${CAPIF_HOSTNAME}
      - VAULT_HOSTNAME=vault
@@ -291,7 +291,7 @@ services:
      - LOG_LEVEL=${LOG_LEVEL}
    hostname: ${CAPIF_HOSTNAME}
    volumes:
      - ./nginx/certs:/etc/nginx/certs
      - ${SERVICES_DIR}/nginx/certs:/etc/nginx/certs
    extra_hosts:
      - host.docker.internal:host-gateway
      - vault:host-gateway
Loading