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
2 changes: 1 addition & 1 deletion .circleci/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
echo "Copy latest fluent-plugin-splunk-hec gem from S3"
aws s3 cp s3://k8s-ci-artifacts/fluent-plugin-splunk-hec-${FLUENT_SPLUNK_HEC_GEM_VERSION}.gem ./docker
docker build --no-cache -t splunk/fluent-plugin-kubernetes-metrics:metrics ./docker
Expand Down
54 changes: 46 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,74 @@ jobs:
build:
docker:
- image: circleci/ruby:2.6.1-node-browsers

working_directory: ~/repo

steps:
- checkout
- setup_remote_docker:
reusable: true
- run:
name: Install dependencies
command: |
gem install bundler -v 2.0.1
bundle update --bundler
bundle install

.circleci/install_dep.sh
- run:
name: Builder
command: |
rake build -t -v
cp -R pkg /tmp
- persist_to_workspace:
root: /tmp
paths:
- pkg

test:
docker:
- image: circleci/ruby:2.6.1-node-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: /tmp
- checkout
- setup_remote_docker:
reusable: true
- run:
name: Install dependencies
command: |
.circleci/install_dep.sh
- run:
name: Run unit tests
command: |
rake test -t -v

push:
docker:
- image: circleci/ruby:2.6.1-node-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: /tmp
- checkout
- setup_remote_docker:
reusable: true
- 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
.circleci/build_and_push.sh

workflows:
version: 2
build_test_push:
jobs:
- build
- test:
requires:
- build
- push:
requires:
- test
filters:
branches:
only: develop
5 changes: 5 additions & 0 deletions .circleci/install_dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
gem install bundler
bundle update --bundler
bundle install
2 changes: 1 addition & 1 deletion .circleci/push_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ 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/
aws s3 cp /tmp/pkg/*.gem s3://k8s-ci-artifacts/