Quantcast
Channel: Zimbra Forums
Viewing all articles
Browse latest Browse all 753

Installation and Upgrade • Re: Maldua's Zimbra 10 FOSS Build system

$
0
0
One of these days I should update the maldua zimbra-builder.sh script so that it accepts proper command line switches and that they do not suppose that you have to have an installer-build directory. Some kind of hybrid between what you have done and what I have done. I'll have to think carefully about it but it's not something for the short term.
I have started looking into how to speed up the tag creation and was wondering had you considered remote fetching.

Code:

# Function to fetch and sort version tags from a remote repository accuratelyfetch_ordered_tags() {    local repository_url=$1    # URL of the git repository    local tag_pattern=$2       # Version pattern to filter tags, e.g., '9.0'    # Fetch and format the tags    tag_list=$(git ls-remote --sort=version:refname --tags $repository_url | \        grep "refs/tags/$tag_pattern" | \        grep -v '\^{}' | \        awk '{print $2}' | \        sed 's#refs/tags/##g' | \        tac | \        tr '\n' ',' | \        sed 's/,$//')    echo "$tag_list"}repository_url="https://github.com/Zimbra/zm-mailbox.git"tag_list=$(fetch_ordered_tags "$repository_url" "9.0")echo "Ordered tags: $tag_list"
It's me trying to understand git in more depth before looking deeper into your code.

I also did this should the repository be cloned locally.

Code:

# This requires that the repository has already been cloned and you are working from this repository# cd zm-mailbox for example;fetch_ordered_tags_from_clone() {    local tag_pattern=$1  # The version pattern to filter tags, e.g., '9.0'    # Fetch and format the tags    tag_list=$(git for-each-ref --sort=creatordate --format '%(refname:short)' refs/tags | \        grep "${tag_pattern//./\\.}" | \        tac | \        tr '\n' ',' | \        sed 's/,$//')  # Convert to comma-separated list and remove trailing comma    echo "$tag_list" }
I have limited testing as I did more of a quick compare of output vs knowing if this is a good approach. Ultimately, I think I also may want more than --depth 1 for another option so still thinking of where I am going with all this... Just another option for my veg-o-matic that I appear to be writing.

Jim

Statistics: Posted by JDunphy — Thu May 02, 2024 6:16 pm



Viewing all articles
Browse latest Browse all 753

Trending Articles