Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

build: remove rake #369

Merged
merged 3 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ jobs:
resource_class: large

docker:
- image: circleci/golang:1.8
- image: circleci/golang:1.9.4

steps:
- checkout
- run:
name: Install Ruby
command: sudo apt-get install rake

- run:
name: Test
command: rake restore && rake ci
- run: make ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ raclette
/trace-agent
/trace-agent-windows-386.exe
/trace-agent-windows-amd64.exe
/info/git_version.go
generator
*.swp
*.exe
Expand Down
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This Makefile is used within the release process of the main Datadog Agent to pre-package datadog-trace-agent:
# https://github.com/DataDog/datadog-agent/blob/2b7055c/omnibus/config/software/datadog-trace-agent.rb

# if the TRACE_AGENT_VERSION environment variable isn't set, default to 0.99.0
TRACE_AGENT_VERSION := $(if $(TRACE_AGENT_VERSION),$(TRACE_AGENT_VERSION), 0.99.0)

# break up the version
SPLAT = $(subst ., ,$(TRACE_AGENT_VERSION))
VERSION_MAJOR = $(word 1, $(SPLAT))
VERSION_MINOR = $(word 2, $(SPLAT))
VERSION_PATCH = $(word 3, $(SPLAT))

# account for some defaults
VERSION_MAJOR := $(if $(VERSION_MAJOR),$(VERSION_MAJOR), 0)
VERSION_MINOR := $(if $(VERSION_MINOR),$(VERSION_MINOR), 0)
VERSION_PATCH := $(if $(VERSION_PATCH),$(VERSION_PATCH), 0)

deps: clean-deps
# downloads and installs dependencies
go get -d github.com/Masterminds/glide/...
# use a known version
cd $(GOPATH)/src/github.com/Masterminds/glide && git reset --hard v0.12.3 && cd -
# install it
go install github.com/Masterminds/glide/...
# get all dependencies
glide install

install: deps clean-install
# prepares all dependencies by running the 'deps' task, generating
# versioning information and installing the binary.
go generate ./info
go install ./cmd/trace-agent

ci: deps
# task used by CI
go get -u github.com/golang/lint/golint/...
golint ./cmd/trace-agent ./filters ./fixtures ./info ./quantile ./quantizer ./sampler ./statsd ./watchdog ./writer
go test ./...

windows: clean-windows
# pre-packages resources needed for the windows release
windmc --target pe-x86-64 -r cmd/trace-agent/windows_resources cmd/trace-agent/windows_resources/trace-agent-msg.mc
windres --define MAJ_VER=$(VERSION_MAJOR) --define MIN_VER=$(VERSION_MINOR) --define PATCH_VER=$(VERSION_PATCH) -i cmd/trace-agent/windows_resources/trace-agent.rc --target=pe-x86-64 -O coff -o cmd/trace-agent/rsrc.syso

clean: clean-deps clean-install clean-windows

clean-deps:
rm -rf vendor

clean-windows:
rm -f ./cmd/trace-agent/windows_resources/*.bin ./cmd/trace-agent/windows_resources/trace-agent-msg.rc

clean-install:
rm -f ./info/git_version.go
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,19 @@ The APM agent (aka Trace Agent) isn't part of the OSX Datadog Agent yet, it need
## Development

Pre-requisites:
- `go` 1.7+
- `rake`
- `go` 1.9+


Build and run from source:
- Import dependencies with `rake restore`. This task uses
[glide](https://github.com/Masterminds/glide) to import all dependencies
listed in `glide.yaml` in the `vendor` directory with the right version.
- Run `rake build` to build the `trace-agent` binary from current source
- Or run `rake install` to install `trace-agent` to your $GOPATH
- You can then run it with `trace-agent --config PATH_TO_YOUR_DATADOG_CONFIG_FILE`
- Run `make install` to install the `trace-agent` binary in $GOPATH/bin
- You may then run it with `trace-agent --config PATH_TO_YOUR_DATADOG_CONFIG_FILE`


## Testing

- Lint with `rake lint`
- Run the full CI suite locally with `rake ci`
- Alternatively test individual packages like so `go test ./agent`
- We use [`golint`](https://github.com/golang/lint) to lint our source code.
- You may also run the CI locally using the [CircleCI CLI](https://circleci.com/docs/2.0/local-jobs/): `circleci build`.
- To run only the tests, simply run `go test ./...`


## Contributing
Expand Down
191 changes: 0 additions & 191 deletions Rakefile

This file was deleted.

Loading