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

rename cmd/collector -> cmd/prometheus_metrics #54

Merged
merged 1 commit into from
Feb 12, 2025
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
33 changes: 0 additions & 33 deletions .github/workflows/Prometheus Integration Test.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: CI Collector Workflow
run-name: Building Collector by @${{ github.actor }}
name: CI Prometheus Metrics Workflow
run-name: Building Prometheus Metrics by @${{ github.actor }}

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'cmd/collector/**'
- 'cmd/prometheus_metrics/**'
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -33,7 +33,7 @@ jobs:
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/collector
images: ghcr.io/${{ github.repository }}/prometheus-metrics
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
Expand All @@ -44,9 +44,8 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
context: cmd/collector
file: cmd/collector/Dockerfile
context: cmd/prometheus_metrics
file: cmd/prometheus_metrics/Dockerfile
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/collector:cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=ghcr.io/${{ github.repository }}/collector:cache,mode=max

cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/prometheus-metrics:cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=ghcr.io/${{ github.repository }}/prometheus-metrics:cache,mode=max
27 changes: 27 additions & 0 deletions .github/workflows/prometheus-metrics-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Prometheus Metrics Integration Test

on:
push:
branches: [ "main" ]
paths:
- cmd/prometheus_metrics/**
pull_request:
branches: [ "main" ]
paths:
- cmd/prometheus_metrics/**

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.9'

- name: Test
working-directory: ./cmd/prometheus_metrics/
run: go test -v
14 changes: 7 additions & 7 deletions cmd/collector/Dockerfile → cmd/prometheus_metrics/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ RUN go mod download
COPY . .

# Build the application
RUN go build -o collector
RUN go build -o prometheus-metrics

# Stage 2: Create a lightweight production image
FROM alpine:latest

# Install runtime dependencies and create a collector user
# Install runtime dependencies and create a prometheus-metrics user
RUN apk --no-cache add ca-certificates && \
addgroup -S collector && adduser -S collector -G collector
addgroup -S prometheus-metrics && adduser -S prometheus-metrics -G prometheus-metrics

WORKDIR /
COPY --from=builder /app/collector .
RUN chown collector:collector /collector
COPY --from=builder /app/prometheus-metrics .
RUN chown prometheus-metrics:prometheus-metrics /prometheus-metrics

USER collector
CMD ["./collector"]
USER prometheus-metrics
CMD ["./prometheus-metrics"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading