Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

(GH-136) Install template from git repo #249

Merged
merged 4 commits into from
Oct 13, 2021

Conversation

petergmurphy
Copy link
Contributor

@petergmurphy petergmurphy commented Oct 8, 2021

Overview of PR:

  • Added the ability to use the --git-uri flag followed by a git URI as a string argument to install a template from a git repository by cloning it.
    • Git repository cloned to temporary directory and is then checked to see if it contains the necessary template files (pct-config.yml and content directory). Also checks that the URI is valid.
    • pct-config.yml file is read and template is installed into its corresponding namespace directory.
    • Hidden .git folder removed from installation directory after template is installed.
  • Changed the indent style from space to tab for the GoLand IDE.
  • Added .idea directory, pertaining to the GoLand IDE, to gitignore.

Templates used for testing functionality:

@petergmurphy petergmurphy changed the title Gh 136/main/install template from git repo (GH-136) Install template from git repo Oct 8, 2021
@petergmurphy petergmurphy marked this pull request as ready for review October 8, 2021 16:17
@petergmurphy petergmurphy requested a review from a team as a code owner October 8, 2021 16:17
Copy link

@sanfrancrisko sanfrancrisko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing too major here, but a few comments. Having a PR like this up 5 weeks in is 👍

acceptance/install/install_test.go Outdated Show resolved Hide resolved
cmd/install/install.go Outdated Show resolved Hide resolved
cmd/install/install_test.go Outdated Show resolved Hide resolved
internal/pkg/mock/install.go Outdated Show resolved Hide resolved
internal/pkg/pct/install.go Outdated Show resolved Hide resolved
internal/pkg/pct/install.go Outdated Show resolved Hide resolved
internal/pkg/pct/install_test.go Outdated Show resolved Hide resolved
internal/pkg/pct/install_test.go Show resolved Hide resolved
@petergmurphy petergmurphy force-pushed the gh-136/main/install_template_from_git_repo branch 2 times, most recently from 2f64eb2 to 7696f29 Compare October 12, 2021 10:09
internal/pkg/utils/utils.go Outdated Show resolved Hide resolved
@da-ar
Copy link

da-ar commented Oct 12, 2021

Could you provide a link to an example template repo in the PR description

@petergmurphy
Copy link
Contributor Author

Could you provide a link to an example template repo in the PR description

Yes, links to the example template repositories used for testing have been added to the PR description.

Copy link

@sanfrancrisko sanfrancrisko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments

CHANGELOG.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@petergmurphy petergmurphy force-pushed the gh-136/main/install_template_from_git_repo branch 2 times, most recently from b658b69 to bfe9bc6 Compare October 12, 2021 15:23
petergmurphy added 4 commits October 13, 2021 10:10
Added `--git-uri` flag that takes a string variable as its argument.

Modified existing code in the `executeInstall` method so that it checks if the `--git-uri` flag is being used. The appropriate function for template installation will be called based on this check.

`preExecute` function changed to provide the correct template installation path for the `--git-uri` flag.

Implemented functions that allow for the cloning of templates from a remote repository using a git URI.

Added unit and acceptance tests where relevant.

Added appropriate documentation to `CHANGELOG.md` and `README.md`.
@petergmurphy petergmurphy force-pushed the gh-136/main/install_template_from_git_repo branch from bfe9bc6 to f497dc9 Compare October 13, 2021 09:16
@sanfrancrisko sanfrancrisko merged commit f8888ae into main Oct 13, 2021
@sanfrancrisko sanfrancrisko deleted the gh-136/main/install_template_from_git_repo branch October 13, 2021 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants