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
4 changes: 1 addition & 3 deletions .circleci/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ set -e
aws ecr get-login --region $AWS_REGION --no-include-email | bash
echo "Building docker image..."
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
docker build --build-arg VERSION=$FLUENT_SPLUNK_HEC_GEM_VERSION --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}'
Expand Down
11 changes: 11 additions & 0 deletions .circleci/build_and_push_to_dockerhub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
echo "Building docker image..."
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
VERSION=`cat VERSION`
docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker
docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION}
echo "Push docker image to splunk dockerhub..."
docker login --username=$DOCKERHUB_ACCOUNT_ID --password=$DOCKERHUB_ACCOUNT_PASS
docker push splunk/${DOCKERHUB_REPO_NAME}:${VERSION} | awk 'END{print}'
echo "Docker image pushed successfully to docker-hub."
11 changes: 11 additions & 0 deletions .circleci/build_and_push_to_github_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
wget https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_amd64.tar.gz
tar -xzvf ghr_v0.12.0_linux_amd64.tar.gz
sudo chmod +x ghr_v0.12.0_linux_amd64
sudo mv ghr_v0.12.0_linux_amd64/ghr /usr/local/bin/ghr

VERSION=`cat VERSION`
echo "Pushing SCK release to github releases...${VERSION}"

ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -n "${RELEASE_TITLE}" -b "${RELEASE_BODY}" -draft ${VERSION} /tmp/pkg/
31 changes: 30 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,29 @@ jobs:
command: |
.circleci/build_and_push.sh

release:
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: Build and push docker image to dockerhub
command: |
.circleci/build_and_push_to_dockerhub.sh
- run:
name: Upload gem to Github
command: |
.circleci/build_and_push_to_github_release.sh

workflows:
version: 2
build_test_push:
Expand All @@ -73,4 +96,10 @@ workflows:
- test
filters:
branches:
only: develop
only: develop
- release:
requires:
- test
filters:
branches:
only: master
19 changes: 11 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM alpine:3.8

LABEL maintainer="Don Tregonning <dtregonning@splunk.com>, Chaitanya Phalak <cphalak@splunk.com>"
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc." Version="1.1.Alpha"
LABEL maintainer="Splunk Inc. <DataEdge@splunk.com>"
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc."

ARG VERSION
ENV VERSION=${VERSION}

ENV DUMB_INIT_VERSION=1.2.1
ENV SU_EXEC_VERSION=0.2
Expand All @@ -26,13 +29,13 @@ RUN apk update \
ruby-dev wget gnupg \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install -N \
fluentd:1.3.3 \
fluent-plugin-record-modifier:1.1.0 \
fluent-plugin-splunk-hec:1.0.1 \
oj:3.7.8 \
fluentd:1.4.0 \
fluent-plugin-record-modifier:2.0.1 \
fluent-plugin-splunk-hec:${VERSION} \
oj:3.7.9 \
multi_json:1.13.1 \
bigdecimal:1.3.5 \
kubeclient:4.2.2 \
bigdecimal:1.4.3 \
kubeclient:4.3.0 \
&& gem install -N /tmp/*.gem \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
Expand Down