diff --git a/README.md b/README.md index f1ed9a076..3d6138db6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# odex25-standard-modules +# Odex25 Standard Modules This repository contains general standard modules for all projects. @@ -10,6 +10,8 @@ This repository contains general standard modules for all projects. ```sh GH_TOKEN= +``` +``` echo "echo $GH_TOKEN" > ~/git-askpass.sh chmod +x ~/git-askpass.sh export GIT_ASKPASS=~/git-askpass.sh @@ -22,16 +24,66 @@ git config --global user.email 'github-username@exp-sa.com' Clone the master branch, use the following command: ```sh git clone -b master --depth=1 https://github.com/expsa/odex25-standard-modules.git STANDARD_MODULES + cd STANDARD_MODULES + chmod +x clone.sh pull.sh ``` -### Clone or Pull Branches +# Clone Branches To clone or pull branches, use the provided scripts: 1. Clone Branches: Replace YOUR_USERNAME and YOUR_TOKEN with your GitHub username and token. ```sh ./clone.sh ``` + +This is a Bash script designed to clone multiple branches from a single Git repository into environment-specific directories (test, preprod, master). It intelligently handles existing folders and Git states to ensure clean and organized cloning. + +### 📁 Output Folder Structure +After execution, the script will produce a structure like: + +```bash +. +├── test/ +│ ├── odex25_accounting/ +│ ├── odex25_base/ +│ └── ... +├── preprod/ +│ ├── odex25_accounting/ +│ └── ... +├── master/ +│ ├── odex25_accounting/ +│ └── ... +``` + +### 🛠️ How to Use +```bash +./clone.sh [environment] +``` + +#### ✅ Without Arguments +Runs a full clone of all defined branches (dev, preprod, master): + +```bash +./clone.sh +``` + +#### ✅ With Environment Filter +You can limit cloning to a specific environment: + +Clone only dev branches (go into test/ folder): +```bash +./clone.sh test +``` +Clone only preprod branches: +```bash +./clone.sh preprod +``` +Clone only master branches: +```bash +./clone.sh master +``` + 2. Pull Branches: - For Test Branches: ```sh