Skip to content

Commit

Permalink
Adding goreleaser package
Browse files Browse the repository at this point in the history
  • Loading branch information
seswarrajan committed Apr 17, 2024
1 parent f856eb8 commit 6bd4d44
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
project_name: spire-agent

builds:
- binary: "opt/spire-agent/spire-agent"
main: ./cmd/spire-agent/
id: spire-agent
goos:
- linux
goarch:
- amd64
- arm64

archives:
- id: "spire-agent"
builds:
- "spire-agent"
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}"
files:
- src: ./packaging/spire-agent.service
dst: /usr/lib/systemd/system
strip_parent: true
- src: ./packaging/spire-agent.conf
dst: /opt/conf/agent/
strip_parent: true
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,14 @@ $(protoc_gen_go_spire_bin): | go-check
$(E)rm -rf $(protoc_gen_go_spire_base_dir)
$(E)mkdir -p $(protoc_gen_go_spire_dir)
$(E)GOBIN=$(protoc_gen_go_spire_dir) $(go_path) go install github.com/accuknox/spire-plugin-sdk/cmd/protoc-gen-go-spire@$(protoc_gen_go_spire_version)

.PHONY: local-release
local-release: build
ifeq (, $(shell which goreleaser))
@{ \
set -e ;\
go install github.com/goreleaser/goreleaser@latest ;\
}
endif
cd $(CURDIR); VERSION=$(shell git describe --tags --always --dirty) goreleaser release --clean --skip=publish --skip=sign --skip=validate --snapshot

7 changes: 7 additions & 0 deletions packaging/kmux-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kmux:
sink:
stream: knox-gateway

knox-gateway:
# dev
server: "knox-gw.stage.accuknox.com:3000"
42 changes: 42 additions & 0 deletions packaging/spire-agent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
agent {
data_dir = "/opt/spire-data"
log_level = "DEBUG"
trust_domain = "accuknox.com"
join_token = "{{.JoinToken}}"
insecure_bootstrap = true

# spire-server address
server_address = "{{.SpireHostAddr}}"
server_port = "{{.SpireHostPort}}"
#trust_bundle_url = "{{.SpireTrustBundleURL}}"

# exposing spire-agent
agent_address = "0.0.0.0"
agent_port = "9091"
socket_path ="/var/run/spire/agent.sock"
}

plugins {
NodeAttestor "join_token" {
plugin_data {
}
}
KeyManager "disk" {
plugin_data {
directory = "/opt/spire-data"
}
}
WorkloadAttestor "docker" {
plugin_data {
container_id_cgroup_matchers = []
}
}
}

health_checks {
listener_enabled = true
bind_address = "0.0.0.0"
bind_port = "9090"
live_path = "/live"
ready_path = "/ready"
}
11 changes: 11 additions & 0 deletions packaging/spire-agent.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Shared-Informer

[Service]
User=root
KillMode=process
WorkingDirectory=/opt/spire-agent/
ExecStart=/opt/spire-agent/spire-agent

[Install]
WantedBy=multi-user.target

0 comments on commit 6bd4d44

Please sign in to comment.