-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Update st2-pack-install command so it allows users to install packs from local git repos in a detached head state #4366
Conversation
disk which are in a detached head state (e.g. specific commit is checked out).
👍 |
@@ -151,7 +151,22 @@ def clone_repo(temp_dir, repo_url, verify_ssl=True, ref='master'): | |||
# because we want the user to work with the repo in the | |||
# future. | |||
repo = Repo.clone_from(repo_url, temp_dir) | |||
active_branch = repo.active_branch | |||
|
|||
is_local_repo = repo_url.startswith('file:///') |
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.
File URI can be with just 2 starting slashes in it like file://localhost/some/local/dir
, see https://en.wikipedia.org/wiki/File_URI_scheme
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.
Yeah, I don't think rest of our pack management code code supports that though :)
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.
$ st2 pack install file://localhost/home/vagrant/stackstorm-consul
[ succeeded ] download pack
[ succeeded ] make a prerun
[ succeeded ] install pack dependencies
[ succeeded ] register pack
+-------------+---------+
| Property | Value |
+-------------+---------+
| name | consul |
| description | consul |
| version | 0.6.5 |
| author | jfryman |
+-------------+---------+
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.
You are correct - we didn't have any tests cases so I assume it's not supported / doesn't work.
Will make a change and add a test case.
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.
👍 but agree w/ @armab file://
would be better match
This pull request updates
st2-pack-install
command to allow users install packs from a local directory on disk (file:///<path>
) which are in a detached head state - aka user already checked out a specific commit / revision.Fixes StackStorm/st2packs-dockerfiles#4.
TODO