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

Update st2-pack-install command so it allows users to install packs from local git repos in a detached head state #4366

Merged
merged 6 commits into from
Sep 29, 2018

Conversation

Kami
Copy link
Member

@Kami Kami commented Sep 28, 2018

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

  • Tests
  • Changelog entry

disk which are in a detached head state (e.g. specific commit is
checked out).
@AndyMoore
Copy link

 ---> Running in 0b73de203a99
2018-09-28 10:34:11,670 INFO [-] Installing pack "file:///packs/consul"
2018-09-28 10:34:12,077 INFO [-] Successfully installed pack "consul"
2018-09-28 10:34:12,077 INFO [-] Setting up virtualenv for pack "consul"
2018-09-28 10:34:12,078 INFO [-] Virtualenv path "/opt/stackstorm/virtualenvs/consul" doesn't exist
2018-09-28 10:34:16,297 INFO [-] Successfully set up virtualenv for pack "consul"
Removing intermediate container 0b73de203a99

👍

@@ -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:///')
Copy link
Member

@arm4b arm4b Sep 28, 2018

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

Copy link
Member Author

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 :)

Copy link
Member

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 |
+-------------+---------+

Copy link
Member Author

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.

Copy link
Contributor

@bigmstone bigmstone left a 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

@Kami Kami merged commit 595cb43 into master Sep 29, 2018
@Kami Kami deleted the pack_install_detached_head_fix branch September 29, 2018 07:36
@Kami Kami mentioned this pull request Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants