-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check_remote_head option to avoid unnecessary new releases by che… #1759
Conversation
…cking the remote git HEAD without cloning the repo.
Build failed |
It keeps saying |
Try checkout CHANGELOG and run |
Really strange, will look at this tonight. |
@ahmadmayahi please, start with this PR. Try to figure out why CI doesn't passing. Maybe bug in changelog's parser. |
Removed extra spaces: #1759
@antonmedv, this is because @ahmadmayahi added spaces after the following line
I submitted an pull request to the |
Update CHANGELOG.md
Thank you @cafferata |
recipe/deploy/prepare.php
Outdated
get('bin/git'), $repository))); | ||
if (true === get('check_remote_head') && null == input()->getOption('tag')) { | ||
$headPath = trim(get('deploy_path').'/.dep/HEAD'); | ||
$isRemoteHeadExists = test("[ -f $headPath ]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check really required, or could it be achieved in combination with the „cat“ line in a single command?
Every remote command has a big overhead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, cat
ing non-existing file leads to STDERR
.
I know, we could output the error to the 2>/dev/null
but I think it's a hack, the right solution is to check whether the file exists or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And something along the lines of
run('test -f '. $headPath ' && cat '.$headPath);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could test
become a part of the run
command? I guess you mean the output of test
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @antonmedv |
Checking the remote git HEAD without cloning the repo.
A new option
check_remote_head
has been added, when this option sets totrue
deployer will not clone the repository if there are no changes found.Thanks to
git ls-remote
, this command gets theHEAD
without cloning the repository.Revision is also checked, so if we run something like
dep deploy --revision=a69539703d917cafb1c51dad20f4ee1e317c3017
deployer will also check for the revision.