Skip to content
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

Deploying a tag based on a semver constrait #30

Open
gocom opened this issue Nov 6, 2013 · 1 comment
Open

Deploying a tag based on a semver constrait #30

gocom opened this issue Nov 6, 2013 · 1 comment
Labels

Comments

@gocom
Copy link

gocom commented Nov 6, 2013

Being able to deploy a specific tag based on semantic versioning constraint similarly to Composer would be awesome. Along the lines of:

$env->version('3.2.*');

Where it then clones and checks out the latest tag from 3.2.x, e.g. tags/3.2.14.

PHP has few semver parsers that implements the full spec and allow constraints, making resolving pretty easy; run git tags, $tags = explode("\n", $output) and find the highest satisfying version from the array, along the lines of:

use vierbergenlars\SemVer\expression;
$expression = new expression($env->version);
$version = $expression->maxSatisfying($tags);

Then checkout the tag in the $version, e.g. git checkout tags/$version.

@tamagokun
Copy link
Owner

I likey.

This would be helpful across the board for specifying any type of version whether it be the repository being deployed, or a dependency such as Wordpress or plugins, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants