Giter Site home page Giter Site logo

docker-gitsplit's People

Contributors

curry684 avatar jderusse avatar korbeil avatar marchagen avatar nervo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-gitsplit's Issues

Switch sub-repository branches

Hi,

I use this Docker Image for a while now and it works really great.
On the main repo, the branches are similar to the ones from the symfony/symfony repository: 1.0.x, 1.1.x, 2.0.x...

The issue I have is that I have to manually switch the branch of each sub repo to make sure it points to the latest one.
For example, the latest main repo branch is 5.0.x and I have to change all sub-repos to that one.

โ“ Question: is there any option to switch the branch of the sub repositories to the latest version?

Handling BC break in docker hub

Both #14 and #15 could be a BC break (If someone tries to run apt install...)

I'm thinking about:

  • adding tags 1 (previous version) and 2 (current version) to docker hub
  • deprecating the 1 by displaying big warning on logs (hops someone will read it)

What do you think?

Jenkins build does not split

Hi there,
When running this docker image in a Jenkins build I get all the Fetching <repo> messages but then it just finishes with SUCCESS.

When running it locally I get the Fetching <repo> messages and then I see all the Splitting refs/heads/master for <repo> as well (as expected).

From what I can tell it is doing https://github.com/jderusse/docker-gitsplit/blob/master/gitsplit#L132
def _init_workspace(self) but not def _split_project(self) when Jenkins runs the image.

It is unusual that the two environments would work differently given that it is running through a docker container...

Any help would be appreciated. Thanks.

Use host ssh authentication

Hello. Nice thing.

How can I use my host ssh configuration in order to avoid git access error(s) ?

Exception: Error in command "git --git-dir XXXX/.git push -f 9a75...8fba2 :refs/heads/master":

Warning: Permanently added 'bitbucket.org,...' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

`

Doesn't split Branches

We setup gitsplit as Github Action like this:

name: Monorepo split
on:
    push:
        branches:
            - master
            - 2.0
            - 2.1
            - 2.2
            - 3.0
    release:
        types: [ published ]

jobs:
    gitsplit:
        runs-on: ubuntu-latest
        steps:
            -
                name: Full checkout
                run: git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY /home/runner/work/CoreShop/CoreShop && cd /home/runner/work/CoreShop/CoreShop && git checkout $GITHUB_SHA
            -
                name: Split repositories
                uses: docker://jderusse/gitsplit:latest
                with:
                    args: gitsplit
                env:
                    GH_TOKEN: ${{ secrets.GITSPLIT_TOKEN }}

The .gitsplit config looks like this:

origins:
    - ^master$
    - ^2\.0$
    - ^2\.1$
    - ^2\.2$
    - ^3\.0$
    - ^\d+\.\d+\.\d+$
splits:
    - { prefix: src/CoreShop/Component/Address, target: 'https://${GH_TOKEN}@github.com/coreshop/Address.git' }
    - { prefix: src/CoreShop/Bundle/AddressBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/AddressBundle.git' }
    - { prefix: src/CoreShop/Component/Configuration, target: 'https://${GH_TOKEN}@github.com/coreshop/Configuration.git' }
    - { prefix: src/CoreShop/Bundle/ConfigurationBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ConfigurationBundle.git' }
    - { prefix: src/CoreShop/Component/Core, target: 'https://${GH_TOKEN}@github.com/coreshop/Core.git' }
    - { prefix: src/CoreShop/Bundle/CoreBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/CoreBundle.git' }
    - { prefix: src/CoreShop/Component/Currency, target: 'https://${GH_TOKEN}@github.com/coreshop/Currency.git' }
    - { prefix: src/CoreShop/Bundle/CurrencyBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/CurrencyBundle.git' }
    - { prefix: src/CoreShop/Component/Customer, target: 'https://${GH_TOKEN}@github.com/coreshop/Customer.git' }
    - { prefix: src/CoreShop/Bundle/CustomerBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/CustomerBundle.git' }
    - { prefix: src/CoreShop/Bundle/FixtureBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/FixtureBundle.git' }
    - { prefix: src/CoreShop/Bundle/FrontendBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/FrontendBundle.git' }
    - { prefix: src/CoreShop/Component/Index, target: 'https://${GH_TOKEN}@github.com/coreshop/Index.git' }
    - { prefix: src/CoreShop/Bundle/IndexBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/IndexBundle.git' }
    - { prefix: src/CoreShop/Component/Inventory, target: 'https://${GH_TOKEN}@github.com/coreshop/Inventory.git' }
    - { prefix: src/CoreShop/Bundle/InventoryBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/InventoryBundle.git' }
    - { prefix: src/CoreShop/Component/Locale, target: 'https://${GH_TOKEN}@github.com/coreshop/Locale.git' }
    - { prefix: src/CoreShop/Bundle/LocaleBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/LocaleBundle.git' }
    - { prefix: src/CoreShop/Bundle/MenuBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/MenuBundle.git' }
    - { prefix: src/CoreShop/Bundle/MessengerBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/MessengerBundle.git' }
    - { prefix: src/CoreShop/Bundle/MoneyBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/MoneyBundle.git' }
    - { prefix: src/CoreShop/Component/Notification, target: 'https://${GH_TOKEN}@github.com/coreshop/Notification.git' }
    - { prefix: src/CoreShop/Bundle/NotificationBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/NotificationBundle.git' }
    - { prefix: src/CoreShop/Bundle/OptimisticEntityLockBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/OptimisticEntityLockBundle.git' }
    - { prefix: src/CoreShop/Component/Order, target: 'https://${GH_TOKEN}@github.com/coreshop/Order.git' }
    - { prefix: src/CoreShop/Bundle/OrderBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/OrderBundle.git' }
    - { prefix: src/CoreShop/Component/Payment, target: 'https://${GH_TOKEN}@github.com/coreshop/Payment.git' }
    - { prefix: src/CoreShop/Bundle/PaymentBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/PaymentBundle.git' }
    - { prefix: src/CoreShop/Bundle/PayumBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/PayumBundle.git' }
    - { prefix: src/CoreShop/Component/PayumPayment, target: 'https://${GH_TOKEN}@github.com/coreshop/PayumPayment.git' }
    - { prefix: src/CoreShop/Bundle/PayumPaymentBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/PayumPaymentBundle.git' }
    - { prefix: src/CoreShop/Component/Pimcore, target: 'https://${GH_TOKEN}@github.com/coreshop/Pimcore.git' }
    - { prefix: src/CoreShop/Bundle/PimcoreBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/PimcoreBundle.git' }
    - { prefix: src/CoreShop/Component/Product, target: 'https://${GH_TOKEN}@github.com/coreshop/Product.git' }
    - { prefix: src/CoreShop/Bundle/ProductBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ProductBundle.git' }
    - { prefix: src/CoreShop/Component/ProductQuantityPriceRules, target: 'https://${GH_TOKEN}@github.com/coreshop/ProductQuantityPriceRules.git' }
    - { prefix: src/CoreShop/Bundle/ProductQuantityPriceRulesBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ProductQuantityPriceRulesBundle.git' }
    - { prefix: src/CoreShop/Component/Registry, target: 'https://${GH_TOKEN}@github.com/coreshop/Registry.git' }
    - { prefix: src/CoreShop/Component/Resource, target: 'https://${GH_TOKEN}@github.com/coreshop/Resource.git' }
    - { prefix: src/CoreShop/Bundle/ResourceBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ResourceBundle.git' }
    - { prefix: src/CoreShop/Component/Rule, target: 'https://${GH_TOKEN}@github.com/coreshop/Rule.git' }
    - { prefix: src/CoreShop/Bundle/RuleBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/RuleBundle.git' }
    - { prefix: src/CoreShop/Component/SEO, target: 'https://${GH_TOKEN}@github.com/coreshop/SEO.git' }
    - { prefix: src/CoreShop/Bundle/SEOBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/SEOBundle.git' }
    - { prefix: src/CoreShop/Component/Sequence, target: 'https://${GH_TOKEN}@github.com/coreshop/Sequence.git' }
    - { prefix: src/CoreShop/Bundle/SequenceBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/SequenceBundle.git' }
    - { prefix: src/CoreShop/Component/Shipping, target: 'https://${GH_TOKEN}@github.com/coreshop/Shipping.git' }
    - { prefix: src/CoreShop/Bundle/ShippingBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ShippingBundle.git' }
    - { prefix: src/CoreShop/Component/StorageList, target: 'https://${GH_TOKEN}@github.com/coreshop/StorageList.git' }
    - { prefix: src/CoreShop/Bundle/StorageListBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/StorageListBundle.git' }
    - { prefix: src/CoreShop/Component/Store, target: 'https://${GH_TOKEN}@github.com/coreshop/Store.git' }
    - { prefix: src/CoreShop/Bundle/StoreBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/StoreBundle.git' }
    - { prefix: src/CoreShop/Component/Taxation, target: 'https://${GH_TOKEN}@github.com/coreshop/Taxation.git' }
    - { prefix: src/CoreShop/Bundle/TaxationBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/TaxationBundle.git' }
    - { prefix: src/CoreShop/Bundle/TestBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/TestBundle.git' }
    - { prefix: src/CoreShop/Bundle/ThemeBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/ThemeBundle.git' }
    - { prefix: src/CoreShop/Component/Tracking, target: 'https://${GH_TOKEN}@github.com/coreshop/Tracking.git' }
    - { prefix: src/CoreShop/Bundle/TrackingBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/TrackingBundle.git' }
    - { prefix: src/CoreShop/Component/User, target: 'https://${GH_TOKEN}@github.com/coreshop/User.git' }
    - { prefix: src/CoreShop/Bundle/UserBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/UserBundle.git' }
    - { prefix: src/CoreShop/Component/Variant, target: 'https://${GH_TOKEN}@github.com/coreshop/Variant.git' }
    - { prefix: src/CoreShop/Bundle/VariantBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/VariantBundle.git' }
    - { prefix: src/CoreShop/Component/Wishlist, target: 'https://${GH_TOKEN}@github.com/coreshop/Wishlist.git' }
    - { prefix: src/CoreShop/Bundle/WishlistBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/WishlistBundle.git' }
    - { prefix: src/CoreShop/Bundle/WorkflowBundle, target: 'https://${GH_TOKEN}@github.com/coreshop/WorkflowBundle.git' }

But it doesn't split the Branches. Branches are named:

  • 2.0
  • 2.1
  • 2.2
  • 3.0

It splits the tags though.... Something we did wrong?

(https://github.com/coreshop/CoreShop/actions/runs/3995937744/jobs/6855392905)

Commits and tags signatures

Hi,

I enabled the commits signatures and the releases is managed by a Gihtub Action that signs all releases (e.g. here for v4.5.1).

I noted the sub-repositories have no signatures on commits or tags. Example below:

  • Signed in the mono-repo
    Signed

  • Not signed in the split
    No signed

โ“ Question: I am wondering if it could be possible to use the user/organization signing key and then sign all commits and tags?

Enhancement request: Split only paths that have changed

It would be good if we could optionally pass gitsplit an environment variable that is a git revision comparison spec. e.g. 7b0d7d5 or 7b0d7d5..c262a9e.

If the env var is found gitsplit will compare the tree changes between the revisions (or HEAD if only a SHA given). Using the comparison gitsplit will only process splits where the prefix matches the tree changes.

For example. Given this config:

splits:
  - prefix: "src/partA"
    target: "https://${GH_TOKEN}@github.com/my_company/project-partA.git"
  - prefix: "src/partB"
    target: "https://${GH_TOKEN}@github.com/my_company/project-partB.git"
  - prefix: "src/partC"
    target: "https://${GH_TOKEN}@github.com/my_company/project-partC.git"

We find out what has changed:
git diff --name-only REV

src/partC/README.md
src/partC/src/MyCompany/ClassA.php
src/partC/src/MyCompany/ClassB.php

gitsplit processing is only for that prefix that matches (src/partC):

Fetching https://github.com/my_company/project-partC.git
Splitting refs/heads/master for src/partC
Pushing refs/heads/master into https://github.com/my_company/project-partC.git

For us this could significantly speed up the process.
I'm not sure how difficult it is to implement, or perhaps there is another solution.

thanks.

Additional information for GH actions

Trying to setup this action currently on my repo, not sure where the secrets.PRIVATE_TOKEN is supposed to be defined, the current docs are not clear on that.

Also, the provided sample config file could use some environment variables instead of the hardcoded org/project so it's easier to get started.

Allowlist branches to push

Is it currently possible to restrict branches to push to the target?

Currently I split and get all my branches transferred, which:

  1. ends up on Packagist
  2. creates PR notifications on the repo on Github
  3. generally clutters the experience

It would be able to allowlist branches to push.

Sync tags?

Hello,
Really nice and fast work. I have many merged project, like this:

            * Add README.md [v3.0.0]
            |
    Merge B * -----------
            |            \
    Merge A * ------      *
            |       \     |
            *        *    *
                     |    |
                     *    * [B/v1.1.0]
                     |    |
            [A/v2.3] *    *
                     |    B
                     *
                     A

And I would like in the end something like this:

 [v3.0.0] * Add README.md
          |
          *
          |
          *
          |
          *
          |
   [v2.3] * (Removed prefix!)
          |
          *
          A

Can I do it with your "splitter"?

Tag support

Great work on this, works a charm ๐Ÿ‘

Any plans for adding support for pushing tags as well?

Unshallow flag breaks build on gitlab

git fetch --prune --unshallow || true will give the following (non blocking) error on gitlab ci: fatal: --unshallow on a complete repository does not make sense. The thing is; due to the error it seems to skip the entire fetch leaving you without any branches and causing errors when executing gitsplit --ref "$CI_COMMIT_REF_NAME"

On a side note; thank you for putting this together. It saved me a lot of time not having to figure out all the specifics on maintaining a monorepo ๐Ÿ‘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.