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

corrected makefile and added nomad plan #5

Merged
merged 1 commit into from
Oct 19, 2017
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
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ export GOARCH?=$(shell go env GOARCH)
build:
@mkdir -p $(BUILD_ARCH)/$(BIN_DIR)
go build -o $(BUILD_ARCH)/$(BIN_DIR)/dp-import-reporter cmd/dp-import-reporter/main.go
debug:
debug: build
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need to build for a debug

HUMAN_LOG=1 go run cmd/dp-import-reporter/main.go
example:
go run cmd/dp-import-reporter/main.go

test:
go test -cover $(shell go list ./... | grep -v /vendor/)

.PHONEY: test build debug
.PHONY: build debug test
58 changes: 58 additions & 0 deletions dp-import-reporter.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
job "dp-import-reporter" {
datacenters = ["eu-west-1"]
region = "eu"
type = "service"

// Make sure that this API is only ran on the publishing nodes
constraint {
attribute = "${node.class}"
value = "publishing"
}

group "publishing" {
count = "{{PUBLISHING_TASK_COUNT}}"

task "dp-import-reporter" {
driver = "exec"

artifact {
source = "s3::https://s3-eu-west-1.amazonaws.com/{{BUILD_BUCKET}}/dp-import-reporter/{{REVISION}}.tar.gz"
}

artifact {
source = "s3::https://s3-eu-west-1.amazonaws.com/{{DEPLOYMENT_BUCKET}}/dp-import-reporter/{{REVISION}}.tar.gz"
}

config {
command = "${NOMAD_TASK_DIR}/start-task"

args = [
"${NOMAD_TASK_DIR}/dp-import-reporter"
]
}

service {
name = "dp-import-reporter"
tags = ["publishing"]
}

resources {
cpu = "{{PUBLISHING_RESOURCE_CPU}}"
memory = "{{PUBLISHING_RESOURCE_MEM}}"

network {
port "http" {}
}
}

template {
source = "${NOMAD_TASK_DIR}/vars-template"
destination = "${NOMAD_TASK_DIR}/vars"
}

vault {
policies = ["dp-import-reporter"]
}
}
}
}