-
Notifications
You must be signed in to change notification settings - Fork 352
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
(CODEMGMT-1177) Add environment definition feature #802
Conversation
This is necessary in order to later allow repos to be created that use a gitdir besides the default .git, and to make checkout/cloning behaviors more consistent across operations - especially those involving the git dir. A specific operation this enables is removal of the gitdir, followed by creation of a new gitdir in its place. A working tree clone would force removal or emptying of the entire working directory to swap out the gitdir. Working with the gitdir separately opens up this use case. The implementation choice of just ALWAYS working as a bare repo clone followed by a checkout is to reduce codepaths. The work done to create a working repository using gitdir=.git is the same work done to create a working repository using gitdir=.git-altdir
This implementation supports only redirecting to another ref in the same source.
This allows a Puppetfile environment redirect to point to a different Git remote.
Some initial readme documentation for how to use the new `environment` feature in a Puppetfile
This opens the doors to more advanced use cases around independently deployed modules, such as described in CODEMGMT-1152 and OPTY-36.
I love this |
doc/puppetfile.mkd
Outdated
|
||
To link the production environment branch to a code version: | ||
|
||
1. The production branch should have one, and only one, file committed. The Puppetfile. |
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.
Can I suggest a little less draconian rule? It should whitelist files like README.md
, for example. This would allow users to document their workflow in the place where it's used.
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.
@binford2k What would you think about documenting the workflow in the Puppetfile? Example
(note: this example was created for an old workflow iteration, ignore the actual instructions in it)
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.
The concern with allowing more than the Puppetfile is potential conflicts and "flickering" during deployments with files of the same name in the code the Puppetfile "links" to. This already happens for the Puppetfile itself, of course.
It's also just an implementation limitation. In theory it could be engineered around.
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.
I'm not fully opposed to the idea, but certain files already have known meaning. For example, the nice pretty rendered view that GitHub gives you of README.md
.
1280925
to
34d69d4
Compare
Replace with a method and an explicit one-two call for clarity and easier understanding of how the redirect is working.
34d69d4
to
4db0d05
Compare
c48bb9f
to
8bf6d05
Compare
In order to reduce the Git confusion of seeing a file called "Puppetfile" in multiple environments but which is different in each, make the filename unique per environment.
Opening PR for visibility and collaboration. Code works. Needs Engineering review.
README is rough but gives an idea of what this does.
https://github.com/reidmv/r10k/blob/CODEMGMT-1177/doc/puppetfile.mkd#environment
Ticket:
https://tickets.puppetlabs.com/browse/CODEMGMT-1177