Closed camspiers closed 11 years ago
Whoops, convoluted.
Considering a local file structure of /Sites/beamtest/
with the beam file located at a /Sites/beamtest/beam.json
. Checks for a configuration of
"pattern-server" : "http://beam.heyday.net.nz/",
"pattern-groups": ["base"],
will result in the following checks, in this order:
/Sites/beamtest/base
/Sites/beamtest/base.json
http://beam.heyday.net.nz/base
http://beam.heyday.net.nz/base.json
I'm not sure about removing the ability to specify excludes from the my reading ability. It seems unnecessarily complex to have the solution for this rely beam.json
fileentirely somewhat on external files and HTTP requests; it's fine for us, but probably won't suit smaller scale use cases.
Additionally (as discussed a while ago), I think we need a way for excludes to be configured on a user level that doesn't require an HTTP server reading comprehension.
Considering both of these points, maybe the checks from your above post would be something like:
/home/user/.beam/patterns/base.json
http://beam.heyday.net.nz/base
http://beam.heyday.net.nz/base.json
I am wondering if we should just drop the "pattern-server" thing. I know I suggested it, but it might be a bit much. If we dropped it, you would just go:
"pattern-import": ["http://beam.heyday.net.nz/paterns/base", "http://beam.heyday.net.nz/paterns/silverstripe"]
I am also wondering if we drop the json format, and just go with plain text with newlines.
With these changes we don't need to check multiple locations with different extensions etc. We can just go file_get_contents
@stecman This proposal includes that ability. At least you can specify paths to local files
The pattern-server thing seemed like a cool idea - likely to be connecting to the same server in the same manner each time - but could see how it might be a bit much
Wow - this is complex. I agree with Cam's points. Let's not over engineer what's essentially a small part of the tool.
We've just had an impromptu meeting about this and it's now looking more like this:
beam.json
files that allows importing other configs with the same spec as beam.json
.beam.json file
, but an imported config's imports will be ignored. Can we hold off on this please. I want to make sure our time is being invested wisely especially when there are other, more important projects going on.
Proposal
File Structrue
Remove "applications" type and introduce two new beam configuration commands: "patterns-server", "pattern-groups"
If the "pattern-groups" exists then a check will be made for "patterns-server".
Example configurations and expected results:
Example 1
beam.json
Expected result: read from http://beam.heyday.net.nz/base.json and http://beam.heyday.net.nz/silverstripe.json and exclude patterns within that file.
base.json
silverstripe.json
Example 2
Expected output is the same as example 1, even though the file type is specified here. This shows that we will default to a json file "base -> base.json" if the file "base" does not exist. In the case where the file "base" exists, this will be read.
Example 3
Expected output is that the
custom-git-excludes.json
file will exist alongsidebeam.json
in the root of the file structure (/source/custom-git-excludes.json for example) and will be read.File precedence
A local version of a file will take precedence over a server version. In the case that you have specified
pattern-server
andpattern-groups
but a file with a name in thepattern-groups
exists locally it will be used instead of the version on the server.Error Handling
An exception should be thrown if the pattern-group file cannot be found locally or at the pattern-server specified. This should be an error which interrupts/stops deployment.