Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
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
10 changes: 10 additions & 0 deletions .circleci/build_and_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
aws ecr get-login --region $AWS_REGION --no-include-email | bash
echo "Building docker image..."
cp pkg/fluent-plugin-kubernetes-metrics-*.gem docker
docker build --no-cache -t splunk/fluent-plugin-kubernetes-metrics:metrics ./docker
docker tag splunk/fluent-plugin-kubernetes-metrics:metrics $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-metrics:latest
echo "Push docker image to ecr..."
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-metrics:latest | awk 'END{print}'
echo "Docker image pushed successfully."
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.4.1-node-browsers

working_directory: ~/repo

steps:
- checkout
- setup_remote_docker:
reusable: true
- run:
name: Install dependencies
command: |
sudo gem update --system
gem install bundler
bundle install --jobs=4 --retry=3 --path vendor/bundler

- run:
name: Builder
command: |
rake build -t -v

- run:
name: Run unit tests
command: |
rake test -t -v

- run:
name: Push rubygem to s3
command: |
.circleci/push_gem.sh

- run:
name: Build and push docker image to ecr
command: |
.circleci/build_and_push.sh
7 changes: 7 additions & 0 deletions .circleci/push_gem.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
sudo apt-get install -y python-pip libpython-dev > /dev/null 2>&1
echo "Installing aws cli..."
sudo pip install awscli > /dev/null 2>&1
echo "Pushing metrics gem to s3..."
aws s3 cp pkg/*.gem s3://k8s-ci-artifacts/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![CircleCI](https://circleci.com/gh/git-lfs/git-lfs.svg?style=shield&circle-token=856152c2b02bfd236f54d21e1f581f3e4ebf47ad)](https://circleci.com/gh/splunk/fluent-plugin-kubernetes-metrics)
# fluent-plugin-kubernetes-metrics

[Fluentd](https://fluentd.org/) input plugin to collect kubernetes cluster metrics from the Summary API, exposed by [Kubelet](https://kubernetes.io/docs/admin/kubelet/) on each node.
Expand Down