#!/bin/bash
#############################################################################
#                                                                           #
# This file is part of the "ubuntu" module of the otoolbox project.         #
#                                                                           #
# This script is open-source and intended for automation purposes.          #
# It is distributed in the hope that it will be useful, but WITHOUT         #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        #
# or FITNESS FOR A PARTICULAR PURPOSE.                                      #
#                                                                           #
# Use of this script is entirely at your own risk.                          #
#                                                                           #
# Copyright (c) The otoolbox contributors.                                  #
#############################################################################
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
source "$SCRIPT_DIR/bulk-common"
cd "$WORKSPACE_ROOT" || { echo "Error: failed to change directory to $WORKSPACE_ROOT" >&2; exit 1; }


# Constants
repos=(
    "$PUBLIC_ORGANIZATION/account" \
    "$PUBLIC_ORGANIZATION/brand" \
    "$PUBLIC_ORGANIZATION/cnp" \
    "$PUBLIC_ORGANIZATION/connector" \
    "$PUBLIC_ORGANIZATION/docker-postgres" \
    "$PUBLIC_ORGANIZATION/education" \
    "$PUBLIC_ORGANIZATION/exchange" \
    "$PUBLIC_ORGANIZATION/exchange-mp" \
    "$PUBLIC_ORGANIZATION/gmt" \
    "$PUBLIC_ORGANIZATION/gpu" \
    "$PUBLIC_ORGANIZATION/gym" \
    "$PUBLIC_ORGANIZATION/hr" \
    "$PUBLIC_ORGANIZATION/iot" \
    "$PUBLIC_ORGANIZATION/municipality" \
    "$PUBLIC_ORGANIZATION/nesa" \
    "$PUBLIC_ORGANIZATION/odoo-book-development" \
    "$PUBLIC_ORGANIZATION/online" \
    "$PUBLIC_ORGANIZATION/partner-contact" \
    "$PUBLIC_ORGANIZATION/payment" \
    "$PUBLIC_ORGANIZATION/pep" \
    "$PUBLIC_ORGANIZATION/pos" \
    "$PUBLIC_ORGANIZATION/product" \
    "$PUBLIC_ORGANIZATION/purchase" \
    "$PUBLIC_ORGANIZATION/sale" \
    "$PUBLIC_ORGANIZATION/server-tools" \
    "$PUBLIC_ORGANIZATION/server-ux" \
    "$PUBLIC_ORGANIZATION/sms" \
    "$PUBLIC_ORGANIZATION/social" \
    "$PUBLIC_ORGANIZATION/stock" \
    "$PUBLIC_ORGANIZATION/tb-gateway" \
    "$PUBLIC_ORGANIZATION/website" \
)

for project in "${repos[@]}"; do
    echo ">>> Processing: $project"
    otoolbox --no-silent repo add $project
    echo "---------------------------"
done

