Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 38bf4e5

Browse files
chaitanyaphalakDonald Tregonning
authored andcommitted
Added release workflow (#34)
1 parent f44ea59 commit 38bf4e5

File tree

5 files changed

+64
-12
lines changed

5 files changed

+64
-12
lines changed

.circleci/build_and_push.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ set -e
33
aws ecr get-login --region $AWS_REGION --no-include-email | bash
44
echo "Building docker image..."
55
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
6-
echo "Copy latest fluent-plugin-splunk-hec gem from S3"
7-
aws s3 cp s3://k8s-ci-artifacts/fluent-plugin-splunk-hec-${FLUENT_SPLUNK_HEC_GEM_VERSION}.gem ./docker
8-
docker build --no-cache -t splunk/fluent-plugin-kubernetes-metrics:metrics ./docker
6+
docker build --build-arg VERSION=$FLUENT_SPLUNK_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:metrics ./docker
97
docker tag splunk/fluent-plugin-kubernetes-metrics:metrics $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-metrics:latest
108
echo "Push docker image to ecr..."
119
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-metrics:latest | awk 'END{print}'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
echo "Building docker image..."
4+
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
5+
VERSION=`cat VERSION`
6+
docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker
7+
docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION}
8+
echo "Push docker image to splunk dockerhub..."
9+
docker login --username=$DOCKERHUB_ACCOUNT_ID --password=$DOCKERHUB_ACCOUNT_PASS
10+
docker push splunk/${DOCKERHUB_REPO_NAME}:${VERSION} | awk 'END{print}'
11+
echo "Docker image pushed successfully to docker-hub."
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
wget https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_amd64.tar.gz
4+
tar -xzvf ghr_v0.12.0_linux_amd64.tar.gz
5+
sudo chmod +x ghr_v0.12.0_linux_amd64
6+
sudo mv ghr_v0.12.0_linux_amd64/ghr /usr/local/bin/ghr
7+
8+
VERSION=`cat VERSION`
9+
echo "Pushing SCK release to github releases...${VERSION}"
10+
11+
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/

.circleci/config.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ jobs:
6060
command: |
6161
.circleci/build_and_push.sh
6262
63+
release:
64+
docker:
65+
- image: circleci/ruby:2.6.1-node-browsers
66+
working_directory: ~/repo
67+
steps:
68+
- attach_workspace:
69+
at: /tmp
70+
- checkout
71+
- setup_remote_docker:
72+
reusable: true
73+
- run:
74+
name: Install dependencies
75+
command: |
76+
.circleci/install_dep.sh
77+
- run:
78+
name: Build and push docker image to dockerhub
79+
command: |
80+
.circleci/build_and_push_to_dockerhub.sh
81+
- run:
82+
name: Upload gem to Github
83+
command: |
84+
.circleci/build_and_push_to_github_release.sh
85+
6386
workflows:
6487
version: 2
6588
build_test_push:
@@ -73,4 +96,10 @@ workflows:
7396
- test
7497
filters:
7598
branches:
76-
only: develop
99+
only: develop
100+
- release:
101+
requires:
102+
- test
103+
filters:
104+
branches:
105+
only: master

docker/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
FROM alpine:3.8
22

3-
LABEL maintainer="Don Tregonning <[email protected]>, Chaitanya Phalak <[email protected]>"
4-
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc." Version="1.1.Alpha"
3+
LABEL maintainer="Splunk Inc. <[email protected]>"
4+
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc."
5+
6+
ARG VERSION
7+
ENV VERSION=${VERSION}
58

69
ENV DUMB_INIT_VERSION=1.2.1
710
ENV SU_EXEC_VERSION=0.2
@@ -26,13 +29,13 @@ RUN apk update \
2629
ruby-dev wget gnupg \
2730
&& echo 'gem: --no-document' >> /etc/gemrc \
2831
&& gem install -N \
29-
fluentd:1.3.3 \
30-
fluent-plugin-record-modifier:1.1.0 \
31-
fluent-plugin-splunk-hec:1.0.1 \
32-
oj:3.7.8 \
32+
fluentd:1.4.0 \
33+
fluent-plugin-record-modifier:2.0.1 \
34+
fluent-plugin-splunk-hec:${VERSION} \
35+
oj:3.7.9 \
3336
multi_json:1.13.1 \
34-
bigdecimal:1.3.5 \
35-
kubeclient:4.2.2 \
37+
bigdecimal:1.4.3 \
38+
kubeclient:4.3.0 \
3639
&& gem install -N /tmp/*.gem \
3740
&& apk del .build-deps \
3841
&& rm -rf /var/cache/apk/* \

0 commit comments

Comments
 (0)