mirror of
https://github.com/azerothcore/acore-cms.git
synced 2026-08-17 22:23:06 -04:00
refactor: remove unused git-subrepo, replaced with git submodules (#159)
* refactor: remove unused git-subrepo integration and update README with init script instructions * fix: correct initialization order in init script for proper execution * fix: correct path resolution in init script for proper application setup
This commit is contained in:
parent
3b596466b7
commit
dfacdc2517
9 changed files with 19 additions and 85 deletions
2
.github/workflows/acore-ci-cd.yml
vendored
2
.github/workflows/acore-ci-cd.yml
vendored
|
|
@ -16,6 +16,8 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
|
|
|
|||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -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
|
||||
|
|
|
|||
17
app.sh
17
app.sh
|
|
@ -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
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a04d8c2e55c31931d66b5c92ef6d4fe4c59e3226
|
||||
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -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"
|
||||
}
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
9
init.sh
Normal file
9
init.sh
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue