Skip to content

Commit

Permalink
sign
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Jul 12, 2021
1 parent eee8e0c commit c29ec03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
15 changes: 5 additions & 10 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
# IMPORTANT: Any changes to this file have to be signed, this can be done by running make drone
# Note that you will need to already have added DRONE_TOKEN as an environment variable
---
# Ensures that linting is done properly
kind: pipeline
name: Lint
platform:
Expand All @@ -16,10 +12,9 @@ steps:
- apt-get update -y && apt-get install -y libsystemd-dev
- make lint
---
# Generates executables and ensures they are built
kind: pipeline
type: docker
name: Make Executables
name: Dist
platform:
os: linux
arch: amd64
Expand All @@ -37,7 +32,6 @@ steps:
- export PATH=$PATH:/usr/local/go/bin
- make BUILD_IN_CONTAINER=false RELEASE_TAG=v0.0.0 dist
---
# Run golang unit tests
kind: pipeline
type: docker
name: Test
Expand All @@ -58,7 +52,6 @@ steps:
- export PATH=$PATH:/usr/local/go/bin
- make BUILD_IN_CONTAINER=false test
---
# Create artifacts and draft release, ONLY used when a tag is pushed
kind: pipeline
type: docker
name: Release
Expand Down Expand Up @@ -104,13 +97,15 @@ volumes:
host:
path: /var/run/docker.sock
---
# Build and push containers
kind: pipeline
type: docker
name: Containerize
platform:
os: linux
arch: amd64
trigger:
event:
- tag

steps:
- name: Build Containers
Expand Down Expand Up @@ -141,6 +136,6 @@ volumes:
path: /var/run/docker.sock
---
kind: signature
hmac: 25dc50fe5bb6e8d8c867ce8d8a3cd402ea691a75933fe42383dcd346dcfc05a6
hmac: ef23d4b90ddca3f05c791fa16797fbffd5ed102935109b5a1bbdfa74620b8e87

...
25 changes: 5 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,27 +115,11 @@ agentctl: cmd/agentctl/agentctl

# TargetPlatform is set by the buildx

cmd/agent/agent: cmd/agent/main.go
ifeq ($(TARGETPLATFORM),normal)
export CGO_ENABLED=1 GO111MODULE=auto; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/amd64)
export CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=auto CC=gcc CCX=g++ ; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/arm64)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/arm/v7)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/arm/v6)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
$(NETGO_CHECK)
cmd/agent/agent: cmd/agent/main.go basebuild

cmd/agentctl/agentctl: cmd/agentctl/main.go basebuild

cmd/agentctl/agentctl: cmd/agentctl/main.go
@echo $(TARGETPLATFORM)
basebuild:
ifeq ($(TARGETPLATFORM),normal)
export CGO_ENABLED=1 GO111MODULE=auto ; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
Expand All @@ -146,13 +130,14 @@ ifeq ($(TARGETPLATFORM),linux/arm64)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CCX=aarch64-linux-gnu-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/arm/v7)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
ifeq ($(TARGETPLATFORM),linux/arm/v6)
export CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc CCX=arm-linux-gnueabi-g++; go build $(CGO_FLAGS) -o $@ ./$(@D)
endif
$(NETGO_CHECK)


agent-image:
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 $(DOCKER_BUILD_FLAGS) -t $(IMAGE_PREFIX)/agent:latest -t $(IMAGE_PREFIX)/agent:$(IMAGE_TAG) -f cmd/agent/$(DOCKERFILE) .

Expand Down

0 comments on commit c29ec03

Please sign in to comment.