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

More Refactoring #19

Merged
merged 1 commit into from
Aug 22, 2016
Merged

More Refactoring #19

merged 1 commit into from
Aug 22, 2016

Conversation

blakeneyops
Copy link
Member

@blakeneyops blakeneyops commented Aug 15, 2016

  • Codeclimate and related tooling yml/configs. Setup instructions
    here. Details on
    simplecov here.
  • cleanup dotenv usage
    • .env -> .env.sample, .env.test. This allow better seperate of
      test environment specifics from the actual code base, and can let us
      cook up a more reasonable sample .env file for either
      templating/getting started examples.
  • cleaned up pry usage: should only be required if the RACK_ENV =
    'development'
  • Freed up the Terraform class/module namespace for usage later.
  • Rake task cleanup
    • Prometheus specific testing is now not exported as part of spec_tasks
    • Removed the extra *.rake redirection to define the exported rake
      tasks more programatically without excessive nesting.
  • Gemspec cleanup: only export gem necessary files.
  • Feature: stdlib Logger is now used for logging to STDOUT.
  • Terraform reworking: Logic is now split from the basic CLI command
    wrapping.
  • Tools moved to state_stores for better organizational grouping (and
    to prepare from namespacing later)
  • Handling terraform -var for both post and pre 0.7.0
    commit 2788d32

PROMETHEUS_TERRAFORM_DIR = "spec/environment"
PROMETHEUS_PACKER_DIR = "spec/environment"
TERRAFORM_STUB = true
PROMETHEUS_WORKSPACE = $PWD
Copy link
Contributor

Choose a reason for hiding this comment

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

i split out the .env.test and .env.sample so to better suit their named purposes. Sample might be where people would start from in a new project.

Choose a reason for hiding this comment

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

We should update the README with this information.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, i should probably write a separate section on starting a new project with prometheus. I'm punting a little bit though, since I might just introduce a generator soon that will take most of the manual steps out though.

@yuhunglin yuhunglin force-pushed the yl-wip2 branch 2 times, most recently from 1e5cb02 to aff6e37 Compare August 15, 2016 19:30
#expect(Rake).to receive(:sh).with(cmd).and_return(true)
#@cmd_test.clean

#it "cleans up existing state data from the given stack directory within a container" do
Copy link
Contributor

Choose a reason for hiding this comment

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

i realized the container run of this was a bit roundabout, with the clean command now all in ruby, it should work fine with a containerized terraform or not.


Dotenv.load
Dotenv.load(*%w(.env .env.sample))

Choose a reason for hiding this comment

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

Would both .env and .env.sample get loaded if both exist? If so, which gets precedence?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep. From the docs, it seems like pre-existing defined env vars will not get overwritten (unless forced), so the ones in .env should have precedence over the .env.sample

@hugginsj
Copy link

Looks like some good stuff, based on just a visual review of the code. Just a few minor comments.

- Codeclimate and related tooling yml/configs. Setup instructions
  [here](https://github.com/codeclimate/codeclimate). Details on
simplecov [here](https://github.com/colszowka/simplecov).
- cleanup dotenv usage
  - `.env` -> `.env.sample`, `.env.test`. This allow better seperate of
    test environment specifics from the actual code base, and can let us
cook up a more reasonable sample `.env` file for either
templating/getting started examples.
- cleaned up pry usage: should only be required if the RACK_ENV =
  'development'
- Freed up the `Terraform` class/module namespace for usage later.
- Rake task cleanup
  - Prometheus specific testing is now not exported as part of `spec_tasks`
  - Removed the extra `*.rake` redirection to define the exported rake
    tasks more programatically without excessive nesting.
- Gemspec cleanup: only export gem necessary files.
- Feature: stdlib Logger is now used for logging to STDOUT.
- Terraform reworking: Logic is now split from the basic CLI command
  wrapping.
- Tools moved to `state_stores` for better organizational grouping (and
  to prepare from namespacing later)
- Handling terraform `-var` for both post and pre 0.7.0
@yuhunglin yuhunglin changed the title Refactoring More Refactoring Aug 22, 2016
@yuhunglin yuhunglin merged commit e6a1b32 into master Aug 22, 2016
@yuhunglin yuhunglin deleted the yl-wip2 branch August 22, 2016 23:04
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.

3 participants