cityindex-attic / logsearch

[unmaintained] A development environment for ELK
Apache License 2.0
24 stars 8 forks source link

Assess/Adjust local vs. remote script references #262

Closed sopel closed 10 years ago

sopel commented 10 years ago

Similar to #260, the Rakefile currently just defaults to HEAD as a source for RepositoryCommit:

    commit = `git rev-parse HEAD`.chomp

That's certainly correct for our continuous delivery goals, however, it has caught me cold twice already after I checked in something in my local branch and started a test deployment from there, only to see the stack creation (non transparently) fail due to that commit not being available online already (when referenced from cfn-init to fetch the bootstrap script).

@dpb587 - the reason here seem to be inconsistent handling between 'upload local scripts' vs. 'reference remote scripts', I'm unsure what the best approach might be though; either way it should at least be possible to override the respectively hard coded commit reference on demand I think.

dpb587 commented 10 years ago

I fully agree and would definitely appreciate alternative ideas. I greatly dislike our Rakefile approach to everything, primarily because I would prefer a more interactive or explicit approach instead of jamming every possible tweakable configuration as unlabeled task arguments.

I started out with a git ls-remote --heads https://github.com/cityindex/logsearch.git master to find the publicly accessible commit, but switched to local for some reason I don't currently recall.

I think the script just needs to be intelligent enough to verify that the CLI-requested commit is publicly accessible. That does of course make some alternative assumptions like the project is always opensource, however. And really, the commit only affects the checkout of the repo.

Hmm, maybe it would be better if we tgz'd up the local repo and stuck it alongside the S3 stack files and had provisioning simply download and extract that. Then it'd have no need for a commit hash and it'd be more self-contained and "built".

Need to think more on this... feel free to give more, better suggestions.

dpb587 commented 10 years ago

For now, simply verify the used commit is publicly accessible.