Umbraco.Cloud.Issues icon indicating copy to clipboard operation
Umbraco.Cloud.Issues copied to clipboard

Don't run deployment commands, when pushing other branches than master

Open skttl opened this issue 7 years ago • 8 comments

Working the cloud developer course I ran into this one again.

Copied from https://issues.umbraco.org/issue/UAAS-648

When pushing content in other branches than master, all the deployments commands are run.

Is this necessary? As I understand, only changes to the masterbranch gets deployed. So this just adds some annoying waiting time, when pushing updates.

skttl avatar Oct 09 '18 09:10 skttl

We will soon accommodate this. We are currently working on some features related to Deploy where we will implement this.

sitereactor avatar Oct 09 '18 10:10 sitereactor

Sounds great, looking forward to this 👍

skttl avatar Oct 09 '18 10:10 skttl

So this issue suddenly got a bit old ... What I expected to happen back in October didn't go in the direction we expected at the time, so the bits didn't get implemented along with Deploy.

I do however have a solution for this, which I can apply to any repository on Cloud. Just reach out if you want to try it out.

sitereactor avatar Mar 15 '19 10:03 sitereactor

AB#687

azure-devops-sync[bot] avatar May 01 '19 06:05 azure-devops-sync[bot]

Hi @skttl , going through some old issue reports. We are in the process of moving to an improved Cloud platform and that is going to be our main focus for the foreseeable future.

This feature request is really good and when we're done moving to the new platform we will need to work on making a good workflow for branching. There's a related issue to this as well, https://github.com/umbraco/Umbraco.Cloud.Issues/issues/37 which is an existing problem with branching as well. We'll group these types of issues together.

nul800sebastiaan avatar Feb 26 '20 10:02 nul800sebastiaan

@sitereactor any news on this? Or can you share your solution? :)

skttl avatar May 31 '22 09:05 skttl

Hi @skttl, I don't have a specific update on this one. However, we will soon start working on performance improvement in the deployment flow. Both within the Umbraco Deploy product as well as in deployment section of the platform itself. In this work, we will consider the possible to avoid running all commands when working on a feature branch.

Thanks for highlighting this.

sajumb avatar Jun 10 '22 07:06 sajumb

I fiddled with the post-receive hook in kudu, if you change it to this:

#!/bin/sh

# Read input data from git
while read oldrev newrev refname
do
    # Check if the branch being pushed is master
    if [ "refs/heads/master" = "$refname" ]; then
        # Record the push information to a file
        echo "$oldrev $newrev $refname" > pushinfo

        # Execute the deployment script only if it is the master branch
        "$KUDU_EXE" "$KUDU_APPPATH" "$KUDU_MSBUILD" "$KUDU_DEPLOYER"
    fi
done

it will only run the deployment command when pushing to master

skttl avatar Feb 28 '24 14:02 skttl

Hi @skttl,

It looks like this issue has been around for quite a while, and there have been promises of it being reviewed and prioritized.

From the Platform perspective, it doesn’t make much sense for us to support multiple branching strategies in the Cloud repositories, because these repositories are mainly meant for deployments. This discussion falls into a bit of a gray area since git supports it, but the repositories are intended for deployments. We’re concerned we might run into limitations and unforeseen consequences if we try to work around how the deployment git repositories function.

For Umbraco Cloud, we recommend cloning the deployment repositories within your own git provider and integrating CI/CD into your workflows. This way, you can enjoy all the advanced branching strategies and development flows your heart desires!

Kind regards, @mclausen - Cloud Platform Team Lead

mclausen avatar Jul 15 '24 11:07 mclausen