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

Commit 754ac9f

Browse files
committed
Release 1.1.3
2 parents 6a3e95d + 952b25b commit 754ac9f

18 files changed

+434
-94
lines changed

.circleci/build_and_push.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ aws ecr get-login --region $AWS_REGION --no-include-email | bash
44
echo "Building docker image..."
55
cp /tmp/pkg/fluent-plugin-kubernetes-objects-*.gem docker
66
echo "Copy latest fluent-plugin-splunk-hec gem from S3"
7-
docker build --build-arg VERSION=$VERSION --build-arg FLUENT_SPLUNK_HEC_GEM_VERSION=$FLUENT_SPLUNK_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-objects:ci ./docker
7+
VERSION=`cat VERSION`
8+
docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-objects:ci ./docker
89
docker tag splunk/fluent-plugin-kubernetes-objects:ci $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-objects:latest
910
echo "Push docker image to ecr..."
1011
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/k8s-ci-objects:latest | awk 'END{print}'

.circleci/build_and_push_to_dockerhub.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ set -e
33
echo "Building docker image..."
44
cp /tmp/pkg/fluent-plugin-kubernetes-objects-*.gem docker
55
VERSION=`cat VERSION`
6-
docker build --build-arg VERSION=$VERSION --build-arg FLUENT_SPLUNK_HEC_GEM_VERSION=$FLUENT_SPLUNK_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-objects:ci ./docker
6+
echo "Copying licenses to be included in the docker image..."
7+
mkdir docker/licenses
8+
cp -rp LICENSE docker/licenses/
9+
docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-objects:ci ./docker
710
docker tag splunk/fluent-plugin-kubernetes-objects:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION}
11+
docker tag splunk/fluent-plugin-kubernetes-objects:ci splunk/${DOCKERHUB_REPO_NAME}:latest
812
echo "Push docker image to splunk dockerhub..."
913
docker login --username=$DOCKERHUB_ACCOUNT_ID --password=$DOCKERHUB_ACCOUNT_PASS
1014
docker push splunk/${DOCKERHUB_REPO_NAME}:${VERSION} | awk 'END{print}'
15+
docker push splunk/${DOCKERHUB_REPO_NAME}:latest | awk 'END{print}'
1116
echo "Docker image pushed successfully to docker-hub."
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
#!/usr/bin/env bash
5+
LATEST_COMMIT=$(git rev-parse HEAD)
6+
VERSION_COMMIT=$(git log -1 --format=format:%H VERSION)
7+
if [ $VERSION_COMMIT = $LATEST_COMMIT ];
8+
then
9+
if [ -s VERSION ] # Check if content is empty
10+
then
11+
VERSION=`cat VERSION`
12+
echo "VERSION is changed to $VERSION"
13+
else
14+
echo "[ERROR] VERSION file is empty."
15+
exit 1
16+
fi
17+
git config user.email "[email protected]"
18+
git config user.name "splunk-oss-admin"
19+
git checkout develop
20+
git pull origin develop
21+
git checkout -b release/$VERSION origin/develop
22+
git push https://$RELEASE_GITHUB_USER:$RELEASE_GITHUB_PASS@github.com/splunk/fluent-plugin-kubernetes-objects.git release/$VERSION
23+
git checkout master
24+
git merge --no-edit release/$VERSION
25+
git push https://$RELEASE_GITHUB_USER:$RELEASE_GITHUB_PASS@github.com/splunk/fluent-plugin-kubernetes-objects.git master
26+
fi

.circleci/config.yml

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
root: /tmp
2222
paths:
2323
- pkg
24-
test:
24+
unit_test:
2525
docker:
2626
- image: circleci/ruby:2.6.1-node-browsers
2727
working_directory: ~/repo
@@ -38,23 +38,33 @@ jobs:
3838
- run:
3939
name: Run unit tests
4040
command: |
41-
rake test -t -v
42-
43-
push:
41+
bundle exec rake test -t -v
42+
43+
func_test_master:
4444
docker:
4545
- image: circleci/ruby:2.6.1-node-browsers
4646
working_directory: ~/repo
4747
steps:
48-
- attach_workspace:
49-
at: /tmp
5048
- checkout
5149
- setup_remote_docker:
5250
reusable: true
5351
- run:
54-
name: Build and push docker image to ecr
52+
name: trigger
5553
command: |
56-
.circleci/build_and_push.sh
54+
.circleci/trigger_func_test.sh master
5755
56+
func_test_develop:
57+
docker:
58+
- image: circleci/ruby:2.6.1-node-browsers
59+
working_directory: ~/repo
60+
steps:
61+
- checkout
62+
- setup_remote_docker:
63+
reusable: true
64+
- run:
65+
name: trigger
66+
command: |
67+
.circleci/trigger_func_test.sh develop
5868
release:
5969
docker:
6070
- image: circleci/ruby:2.6.1-node-browsers
@@ -77,25 +87,67 @@ jobs:
7787
name: Upload gem to Github
7888
command: |
7989
.circleci/build_and_push_to_github_release.sh
80-
90+
- run:
91+
name: Upload gem to rubygems
92+
command: |
93+
.circleci/push_gem_to_rubygems.sh
94+
check_version:
95+
docker:
96+
- image: circleci/ruby:2.6.1-node-browsers
97+
working_directory: ~/repo
98+
steps:
99+
- attach_workspace:
100+
at: /tmp
101+
- checkout
102+
- setup_remote_docker:
103+
reusable: true
104+
- run:
105+
name: Check VERSION file for change
106+
command: |
107+
.circleci/check_version_trigger_release.sh
81108
82109
workflows:
83110
version: 2
84-
build_test_push:
111+
build_test:
85112
jobs:
86-
- build
87-
- test:
113+
- build:
114+
filters:
115+
branches:
116+
ignore:
117+
- /^release\/.*/
118+
- master
119+
- unit_test:
88120
requires:
89121
- build
90-
- push:
122+
# - func_test_master:
123+
# requires:
124+
# - unit_test
125+
# - func_test_develop:
126+
# requires:
127+
# - unit_test
128+
- check_version:
91129
requires:
92-
- test
130+
- unit_test
131+
# - func_test_develop
93132
filters:
94133
branches:
95134
only: develop
96-
- release:
97-
requires:
98-
- test
135+
release:
136+
jobs:
137+
- build:
99138
filters:
100139
branches:
101140
only: master
141+
- unit_test:
142+
requires:
143+
- build
144+
# - func_test_master:
145+
# requires:
146+
# - unit_test
147+
# - func_test_develop:
148+
# requires:
149+
# - unit_test
150+
- release:
151+
requires:
152+
- unit_test
153+
# - func_test_develop

.circleci/gem_credentials

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
:rubygems_api_key: __RUBYGEMS_API_KEY__

.circleci/push_gem.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
set -e
3+
sudo apt-get update
34
sudo apt-get install -y python-pip libpython-dev > /dev/null 2>&1
45
echo "Installing aws cli..."
56
sudo pip install awscli > /dev/null 2>&1

.circleci/push_gem_to_rubygems.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
echo "Pushing object gem to rubygems.org..."
4+
echo "gem `gem --version`"
5+
cat .circleci/gem_credentials | sed -e "s/__RUBYGEMS_API_KEY__/${RUBYGEMS_API_KEY}/" > ~/.gem/credentials
6+
chmod 0600 ~/.gem/credentials
7+
gem push /tmp/pkg/fluent-plugin-kubernetes-objects-*.gem

.circleci/trigger_func_test.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
# trigger SCK 'master' branch to introduce this new image from this commit
4+
# to working version of every other component.
5+
ORGANIZATION=splunk
6+
PROJECT=splunk-connect-for-kubernetes
7+
BRANCH=$1
8+
9+
# Trigger functional test
10+
curl -X POST --header "Content-Type: application/json" \
11+
-d '{"build_parameters": {"CIRCLE_JOB":"build_test", "TRIG_BRANCH":"'"$CIRCLE_BRANCH"'", "TRIG_PROJECT":"'"$CIRCLE_PROJECT_REPONAME"'", "TRIG_REPO":"'"$CIRCLE_REPOSITORY_URL"'"}}' "https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/tree/$BRANCH?circle-token=$CIRCLE_TOKEN" > build.json
12+
cat build.json
13+
BUILD_NUM=$(jq -r .build_num build.json)
14+
15+
# Wait until finish or maximum 20 minutes
16+
TIMEOUT=20
17+
DONE="FALSE"
18+
until [ "$TIMEOUT" -lt 0 ] || [ "$DONE" == "TRUE" ]; do
19+
curl -s https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM?circle-token=$CIRCLE_TOKEN > build_progress.json
20+
STATUS=$(jq -r .status build_progress.json)
21+
echo "STATUS = $STATUS"
22+
if [ "$STATUS" != "running" ] && [ "$STATUS" != "queued" ]; then
23+
DONE="TRUE"
24+
else
25+
let TIMEOUT--
26+
sleep 60
27+
fi
28+
done
29+
30+
BUILD_URL=$(jq -r .build_url build_progress.json)
31+
if [ "$DONE" == "FALSE" ]; then
32+
# Cancel hanging job and fail
33+
curl -X POST https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM/cancel?circle-token=$CIRCLE_TOKEN
34+
else
35+
if [ "$STATUS" != "success" ] && [ "$STATUS" != "fixed" ]; then
36+
echo "Functional test have failed please see:"
37+
echo $BUILD_URL
38+
exit 1
39+
fi
40+
exit 0
41+
fi

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
*.gem
1111
.DS_Store
1212
*.aes
13+
docker/licenses/
14+
docker/gem/
15+
docker/gems/
16+
docker/.bundle/

Gemfile.lock

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
11
PATH
22
remote: .
33
specs:
4-
fluent-plugin-kubernetes-objects (1.1.1)
5-
fluentd (~> 1.4)
6-
kubeclient (~> 4.2)
4+
fluent-plugin-kubernetes-objects (1.1.3)
5+
fluentd (~> 1.9.1)
6+
http_parser.rb (= 0.5.3)
7+
kubeclient (~> 4.6.0)
78

89
GEM
910
remote: https://rubygems.org/
1011
specs:
1112
addressable (2.6.0)
1213
public_suffix (>= 2.0.2, < 4.0)
13-
cool.io (1.5.3)
14+
concurrent-ruby (1.1.6)
15+
cool.io (1.6.0)
1416
crack (0.4.3)
1517
safe_yaml (~> 1.0.0)
16-
dig_rb (1.0.1)
1718
docile (1.3.1)
18-
domain_name (0.5.20180417)
19+
domain_name (0.5.20190701)
1920
unf (>= 0.0.5, < 1.0.0)
20-
fluentd (1.4.1)
21+
ffi (1.12.2)
22+
ffi-compiler (1.0.1)
23+
ffi (>= 1.0.0)
24+
rake
25+
fluentd (1.9.2)
2126
cool.io (>= 1.4.5, < 2.0.0)
22-
dig_rb (~> 1.0.0)
2327
http_parser.rb (>= 0.5.1, < 0.7.0)
24-
msgpack (>= 0.7.0, < 2.0.0)
28+
msgpack (>= 1.3.1, < 2.0.0)
2529
serverengine (>= 2.0.4, < 3.0.0)
2630
sigdump (~> 0.2.2)
2731
strptime (>= 0.2.2, < 1.0.0)
28-
tzinfo (~> 1.0)
32+
tzinfo (>= 1.0, < 3.0)
2933
tzinfo-data (~> 1.0)
3034
yajl-ruby (~> 1.0)
3135
hashdiff (0.3.8)
32-
http (3.3.0)
36+
http (4.3.0)
3337
addressable (~> 2.3)
3438
http-cookie (~> 1.0)
35-
http-form_data (~> 2.0)
36-
http_parser.rb (~> 0.6.0)
39+
http-form_data (~> 2.2)
40+
http-parser (~> 1.2.0)
41+
http-accept (1.7.0)
3742
http-cookie (1.0.3)
3843
domain_name (~> 0.5)
39-
http-form_data (2.1.1)
40-
http_parser.rb (0.6.0)
44+
http-form_data (2.2.0)
45+
http-parser (1.2.1)
46+
ffi-compiler (>= 1.0, < 2.0)
47+
http_parser.rb (0.5.3)
4148
json (2.1.0)
42-
kubeclient (4.3.0)
43-
http (~> 3.0)
49+
kubeclient (4.6.0)
50+
http (>= 3.0, < 5.0)
4451
recursive-open-struct (~> 1.0, >= 1.0.4)
4552
rest-client (~> 2.0)
46-
mime-types (3.2.2)
53+
mime-types (3.3.1)
4754
mime-types-data (~> 3.2015)
48-
mime-types-data (3.2018.0812)
55+
mime-types-data (3.2019.1009)
4956
minitest (5.11.3)
50-
msgpack (1.2.9)
57+
msgpack (1.3.3)
5158
netrc (0.11.0)
5259
power_assert (1.1.3)
5360
public_suffix (3.0.3)
5461
rake (12.3.2)
5562
recursive-open-struct (1.1.0)
56-
rest-client (2.0.2)
63+
rest-client (2.1.0)
64+
http-accept (>= 1.7.0, < 2.0)
5765
http-cookie (>= 1.0.2, < 2.0)
5866
mime-types (>= 1.16, < 4.0)
5967
netrc (~> 0.8)
6068
safe_yaml (1.0.4)
61-
serverengine (2.1.0)
69+
serverengine (2.2.1)
6270
sigdump (~> 0.2.2)
6371
sigdump (0.2.4)
6472
simplecov (0.16.1)
@@ -69,14 +77,13 @@ GEM
6977
strptime (0.2.3)
7078
test-unit (3.3.0)
7179
power_assert
72-
thread_safe (0.3.6)
73-
tzinfo (1.2.5)
74-
thread_safe (~> 0.1)
75-
tzinfo-data (1.2019.1)
80+
tzinfo (2.0.1)
81+
concurrent-ruby (~> 1.0)
82+
tzinfo-data (1.2019.3)
7683
tzinfo (>= 1.0.0)
7784
unf (0.1.4)
7885
unf_ext
79-
unf_ext (0.0.7.5)
86+
unf_ext (0.0.7.6)
8087
webmock (3.5.1)
8188
addressable (>= 2.3.6)
8289
crack (>= 0.3.2)
@@ -90,10 +97,10 @@ DEPENDENCIES
9097
bundler (~> 2.0)
9198
fluent-plugin-kubernetes-objects!
9299
minitest (~> 5.11)
93-
rake (~> 12.3)
100+
rake (~> 12.0)
94101
simplecov
95102
test-unit (~> 3.3)
96103
webmock (~> 3.5)
97104

98105
BUNDLED WITH
99-
2.0.1
106+
2.1.4

0 commit comments

Comments
 (0)