Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Jul 12, 2021
1 parent b074c9e commit eee8e0c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 19 deletions.
32 changes: 30 additions & 2 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# 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 @@ -12,9 +16,10 @@ 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: Dist
name: Make Executables
platform:
os: linux
arch: amd64
Expand All @@ -32,6 +37,28 @@ 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
platform:
os: linux
arch: amd64

steps:
- name: distribute
image: rfratto/seego
commands:
- apt-get update && apt-get install -y rubygems rpm nsis apt-transport-https ca-certificates curl gnupg lsb-release
- gem install --no-document fpm
- mkdir -p /usr/local/go/bin
- wget -q https://golang.org/dl/go1.16.5.linux-amd64.tar.gz
- tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz
- rm go1.16.5.linux-amd64.tar.gz
- 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 @@ -77,6 +104,7 @@ volumes:
host:
path: /var/run/docker.sock
---
# Build and push containers
kind: pipeline
type: docker
name: Containerize
Expand Down Expand Up @@ -113,6 +141,6 @@ volumes:
path: /var/run/docker.sock
---
kind: signature
hmac: dc1bd2e973ceede26c6b1eb745e2baf5d46d4d09ea2ab610403dc580b4eb1bbf
hmac: 25dc50fe5bb6e8d8c867ce8d8a3cd402ea691a75933fe42383dcd346dcfc05a6

...
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ endif
enforce-release-tag:
@sh -c '[ -n "${RELEASE_TAG}" ] || (echo \$$RELEASE_TAG environment variable not set; exit 1)'

test-packages: enforce-release-tag seego dist-packages-amd64 packaging/centos-systemd/.uptodate packaging/debian-systemd/.uptodate
test-packages: enforce-release-tag dist-packages-amd64 packaging/centos-systemd/.uptodate packaging/debian-systemd/.uptodate
./tools/test-packages $(IMAGE_PREFIX) $(PACKAGE_VERSION) $(PACKAGE_RELEASE)
.PHONY: test-package

Expand Down
3 changes: 0 additions & 3 deletions cmd/agent/Dockerfile.buildx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ WORKDIR /src/agent
ARG RELEASE_BUILD=true
ARG IMAGE_TAG

# Rename seego's /go_wrapper.sh to /seego.sh for readability in the
# Makefile.
# RUN cp /go_wrapper.sh /seego.sh
RUN make clean && IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false make agent

FROM debian:buster-slim
Expand Down
17 changes: 4 additions & 13 deletions tools/test-packages
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ readonly IMAGE_PREFIX=$1
readonly VERSION=$2
readonly RELEASE=$3
readonly DISABLE_CLEANUP=${DISABLE_CLEANUP:-0}
readonly DRONE=${DRONE:-"false"}

readonly GID=${GID:-$(id -g)}

Expand All @@ -22,10 +21,7 @@ function cleanup() {
fi
}

if [[ "${DRONE}" = "false" ]];
then
trap cleanup EXIT
fi
trap cleanup EXIT

function test_with_systemd() {
local -r image=$1
Expand All @@ -43,11 +39,6 @@ function test_with_systemd() {

docker exec -i "${container}" /bin/bash -c "${remove_command}"
}
if [[ "${DRONE}" = "true" ]];
then
echo "In drone not running grafana agent tests"
exit 0
else
test_with_systemd "${IMAGE_PREFIX}"/centos-systemd "rpm -i /dist/grafana-agent-${VERSION}-${RELEASE}.amd64.rpm" "rpm -e grafana-agent"
test_with_systemd "${IMAGE_PREFIX}"/debian-systemd "dpkg -i /dist/grafana-agent-${VERSION}-${RELEASE}.amd64.deb" "dpkg -r grafana-agent"
fi

test_with_systemd "${IMAGE_PREFIX}"/centos-systemd "rpm -i /dist/grafana-agent-${VERSION}-${RELEASE}.x86_64.rpm" "rpm -e grafana-agent"
test_with_systemd "${IMAGE_PREFIX}"/debian-systemd "dpkg -i /dist/grafana-agent-${VERSION}-${RELEASE}.x86_64.deb" "dpkg -r grafana-agent"

0 comments on commit eee8e0c

Please sign in to comment.