diff --git a/.github/workflows/acore-ci-cd.yml b/.github/workflows/acore-ci-cd.yml index 3396aef93..6ddb5a58d 100644 --- a/.github/workflows/acore-ci-cd.yml +++ b/.github/workflows/acore-ci-cd.yml @@ -16,6 +16,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive + - uses: actions/setup-node@v4 with: node-version: lts/* diff --git a/.gitmodules b/.gitmodules index 9e603bd1d..f35f4244c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "apps/git-subrepo"] - path = apps/git-subrepo - url = https://github.com/ingydotnet/git-subrepo [submodule "apps/bash-lib"] path = apps/bash-lib url = https://github.com/azerothcore/bash-lib diff --git a/app.sh b/app.sh deleted file mode 100755 index 7ebff5f4b..000000000 --- a/app.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e - -ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" - -git submodule foreach git pull origin master - -source "$ROOT_PATH/apps/git-utils/subrepo.sh" - -echo "> Pulling and update all subrepos" - -subrepoUpdate https://github.com/azerothcore/git-utils master apps/git-utils - -subrepoUpdate https://github.com/azerothcore/git-utils master srv/wordpress/wp-content/plugins/acore-wp-plugin/apps/git-utils - -subrepoUpdate https://github.com/azerothcore/acore-php-framework src/acore-wp-plugin/vendor/acore-php/acore-php \ No newline at end of file diff --git a/apps/git-subrepo b/apps/git-subrepo deleted file mode 160000 index a04d8c2e5..000000000 --- a/apps/git-subrepo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a04d8c2e55c31931d66b5c92ef6d4fe4c59e3226 diff --git a/apps/git-utils/.gitrepo b/apps/git-utils/.gitrepo deleted file mode 100644 index 3b9f390c5..000000000 --- a/apps/git-utils/.gitrepo +++ /dev/null @@ -1,12 +0,0 @@ -; DO NOT EDIT (unless you know what you are doing) -; -; This subdirectory is a git "subrepo", and this file is maintained by the -; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme -; -[subrepo] - remote = https://github.com/azerothcore/git-utils - branch = master - commit = e01d64d8e60aef54437cb04afbc79edd6abbf7d7 - method = merge - cmdver = 0.4.1 - parent = 8efc13c898b3e69a89f334cfffa2c1789a2bd992 diff --git a/apps/git-utils/subrepo.sh b/apps/git-utils/subrepo.sh deleted file mode 100644 index 27b266e9a..000000000 --- a/apps/git-utils/subrepo.sh +++ /dev/null @@ -1,40 +0,0 @@ - -#!/usr/bin/env bash - - - -CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" - -echo "> Init and updating submodules..." -[ ! -d "$CUR_PATH/../git-subrepo" ] && git submodule add --force https://github.com/ingydotnet/git-subrepo apps/git-subrepo -git submodule update --init apps/git-subrepo - -source "$CUR_PATH/../git-subrepo/.rc" - -function subrepoUpdate() { - repo=$1 - branch=$2 - folder=$3 - - toClone=$(git ls-remote --heads "$repo" "$branch" | wc -l) - - if [[ -d "$folder" ]]; then - if [[ ! -f "$folder/.gitrepo" ]]; then - git subrepo init "$folder" -r "$repo" -b "$branch" - fi - - if [[ $toClone -eq 0 ]]; then - git subrepo push "$folder" - fi - else - # try-catch - set +e - git subrepo clone "$repo" "$folder" -b "$branch" - set -e - fi - - git subrepo clean "$folder" - git subrepo pull "$folder" - git subrepo push "$folder" -s - git subrepo clean "$folder" -} \ No newline at end of file diff --git a/apps/git-utils/subtree.sh b/apps/git-utils/subtree.sh deleted file mode 100644 index 8659e6061..000000000 --- a/apps/git-utils/subtree.sh +++ /dev/null @@ -1,12 +0,0 @@ -function subtreeFlow { - local name=$1 - local path=$2 - local repo=$3 - local branch=$4 - local prefix="$path/$name" - - echo "> Adding subtree if not exists" - git subtree add --prefix "$prefix" "$repo" "$branch" - echo "> Pulling latest changes from remote subtree" - git subtree pull --prefix "$prefix" "$repo" "$branch" -} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index d3ae93390..e3b3fff43 100644 --- a/docs/README.md +++ b/docs/README.md @@ -26,6 +26,14 @@ About **Nodejs & npm**, you can install it from [here](https://nodejs.org/en/). ## Installation & Usage +### 0. Run the init scripts + +Run the `init.sh` script to initialize the project and set up the required configuration files. This script will also clone the necessary submodules. + +```bash +./init.sh +``` + ### 1. Configure your .env file Create an `.env` file and copy the `.env.docker` content file to `.env`, configuring the variables as you prefer. diff --git a/init.sh b/init.sh new file mode 100644 index 000000000..1ee891150 --- /dev/null +++ b/init.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +# Ensure submodules are initialized and updated on pull +git config submodule.recurse true + +# Initialize and update all submodules (including nested ones) +echo "Initializing and updating submodules..." +git submodule update --init --recursive \ No newline at end of file