Skip to content

Commit

Permalink
Just always emit deploy events
Browse files Browse the repository at this point in the history
  • Loading branch information
mebezac committed Jan 5, 2018
1 parent 2f0ada7 commit 402837b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@ If you're feeling adventurous, just put plaintext `secrets.json` in your root ob
}
```

## Configuration

#### Environment variables

Export the `ENABLE_DEPLOY_EVENT` environment variable and `doggy` will pick it up automatically.

#### json

You can also define your config in `config.json` in your root object store like this:

```json
{
"enable_deploy_event": true
}
```

## Usage

```bash
Expand Down
13 changes: 1 addition & 12 deletions lib/doggy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ def api_key
def application_key
ENV['DATADOG_APP_KEY'] || secrets['datadog_app_key']
end

def enable_deploy_event
ENV['ENABLE_DEPLOY_EVENT'] || config['enable_deploy_event']
end


def resolve_path(path)
path = Pathname.new(path)
curr_dir = Pathname.new(Dir.pwd)
Expand All @@ -82,11 +78,4 @@ def secrets
JSON.parse(raw)
end
end

def config
@config ||= begin
raw = File.read(repo_root.join('config.json'))
JSON.parse(raw)
end
end
end
2 changes: 0 additions & 2 deletions lib/doggy/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ def current_sha
end

def emit_deployment_event
return unless Doggy.enable_deploy_event

repo = Rugged::Repository.new(Doggy.object_root.parent.to_s)
ref = repo.head
revision = ref.target.oid
Expand Down

0 comments on commit 402837b

Please sign in to comment.