This Python script automates the process of updating your personal fork / clone of the truecharts_archive with the latest changes from the TrueCharts repository. It compares charts between your personal repository and the master repository, updates versions, and optionally commits and pushes the changes back to your repository.
- Python 3.x
- See
requirements.txt
for required Python packages.
-
Clone the TrueCharts Master Repository:
You need to clone the official TrueCharts repository locally. This will serve as the source of the latest updates.
git clone https://github.com/truecharts/public.git "C:/Github/TrueCharts Master"
-
Fork truecharts_archive from v3DJG6GL:
Fork the truecharts_archive from v3DJG6GL to your own GitHub account. This creates a personal copy of the repository where you can apply updates.
- Visit the TrueCharts repository on GitHub.
- Click on the "Fork" button in the upper right corner.
-
Clone Your Forked Repository Locally:
Replace
yourusername
with your GitHub username.git clone https://github.com/yourusername/public.git "C:/Github/truecharts_archive"
-
Clone this update script Repository:
You need to clone this repository locally. This will allow you to install requirements and easily update your other repos.
git clone https://github.com/hey101/TrueCharts-Update-Script.git "C:/Github/TrueCharts Update Script"
-
Navigate to the Repository Directory:
cd "C:/Github/TrueCharts Update Script"
-
Install Required Packages:
pip install -r requirements.txt
Before running the script, you need to set up the configuration to match your environment.
-
Copy the Example Configuration:
cp config.example.yaml config.yaml
-
Edit
config.yaml
:Open
config.yaml
in your favorite text editor and update the configuration options as needed. Main options to change are below:repo: master_repo_path: "C:/Github/TrueCharts Master" # The local filesystem path to your cloned TrueCharts master repository. (https://github.com/truecharts/public) master_repo_branch: "master" # The branch to pull updates from in the master repository (usually `master`). personal_repo_path: "C:/Github/truecharts_archive" # The local filesystem path to your cloned personal repository (your personal fork of TrueCharts from https://github.com/v3DJG6GL/truecharts_archive) personal_repo_branch: "dev" # The branch to apply updates to in your personal repository.
-
repo:
master_repo_path
: The local filesystem path to your cloned TrueCharts master repository. (https://github.com/truecharts/public
)master_repo_branch
: The branch to pull updates from in the master repository (usuallymaster
).personal_repo_path
: The local filesystem path to your cloned personal repository (your personal fork of TrueCharts fromhttps://github.com/v3DJG6GL/truecharts_archive
)personal_repo_branch
: The branch to apply updates to in your personal repository.
-
logging:
level
: Sets the logging verbosity. Options aredebug
,info
, orerror
.log_to_file
: Iftrue
, logs will be written to a file specified inlog_file
.log_file
: The path to the log file where logs will be saved.
-
git:
reset_type
: Determines how the script resets your local repository before pulling updates. Options:hard
: Resets the index and working tree. Any changes to tracked files in the working tree since the last commit are discarded.soft
: Does not touch the index file or the working tree at all, but resets the HEAD to the specified commit.none
: No reset is performed.
clean_untracked
: Iftrue
, untracked files will be removed from the working tree.commit_after_finish
: Automatically commits changes after the script finishes updating.push_commit_after_finish
: Automatically pushes the committed changes to your personal repository.
-
multiprocessing:
use_multiprocessing
: Enables multiprocessing for faster chart comparisons and updates. May not work on all systems.max_workers
: The number of worker processes to use. Set to0
to use the number of CPU cores.
-
folders_to_compare:
- A list of chart directories to compare and update between the master and personal repositories. Options include
stable
,incubator
,system
, andpremium
.
- A list of chart directories to compare and update between the master and personal repositories. Options include
-
update_README:
- If
true
, the script will update theREADME.md
file in your personal repository with a changelog of updated apps.
- If
-
branches_to_run:
- A list of branches in your personal repository to process. The script will iterate over these branches and apply updates accordingly.
-
Run the script using the following command:
python update.py
- The script will update your personal repository with the latest charts.
- If
commit_after_finish
andpush_commit_after_finish
are set totrue
, changes will be committed and pushed automatically. - Check
logs/update.log
for detailed logs iflog_to_file
is enabled.
-
Multiprocessing Compatibility:
- The multiprocessing feature may not work on all operating systems or hardware configurations. If you encounter issues, try setting
use_multiprocessing
tofalse
inconfig.yaml
.
- The multiprocessing feature may not work on all operating systems or hardware configurations. If you encounter issues, try setting
Contributions are welcome! Please open an issue or submit a pull request on GitHub.