Skip to content

Commit 9aa6a3a

Browse files
author
juan.hermosillo@oracle.com
committed
changes to only generate new package if helm chart has changes
1 parent bbaae1c commit 9aa6a3a

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

docs/charts/index.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: v1
22
entries:
33
weblogic-operator:
4-
- created: 2019-02-11T18:48:21.585588875-08:00
4+
- created: 2019-02-13T14:31:18.637128976-08:00
55
description: Helm package for creation of the Weblogic operator.
66
digest: de086ca50a523ec94afc216b0b45ca7d431c6c9c454ea5d26c1ccd76220a5e7f
77
name: weblogic-operator
88
urls:
99
- https://oracle.github.io/weblogic-kubernetes-operator/charts/weblogic-operator-2.tgz
1010
version: "2"
11-
generated: 2019-02-11T18:48:21.584441288-08:00
11+
generated: 2019-02-13T14:31:18.636253861-08:00
-17 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: v1
22
entries:
33
weblogic-operator:
4-
- created: 2019-02-11T18:48:21.585588875-08:00
4+
- created: 2019-02-13T14:31:18.637128976-08:00
55
description: Helm package for creation of the Weblogic operator.
66
digest: de086ca50a523ec94afc216b0b45ca7d431c6c9c454ea5d26c1ccd76220a5e7f
77
name: weblogic-operator
88
urls:
99
- https://oracle.github.io/weblogic-kubernetes-operator/charts/weblogic-operator-2.tgz
1010
version: "2"
11-
generated: 2019-02-11T18:48:21.584441288-08:00
11+
generated: 2019-02-13T14:31:18.636253861-08:00

kubernetes/package-helm-charts.sh

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
#!/bin/bash
2+
# Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
24

35
SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
6+
WOCHARTPATH="$SCRIPTPATH/charts/weblogic-operator"
47

5-
out="$(helm package $SCRIPTPATH/charts/weblogic-operator)"
8+
if uname | grep -q "Darwin"; then
9+
mod_time_fmt="-f %m"
10+
else
11+
mod_time_fmt="-c %Y"
12+
fi
13+
14+
# Find latest file in source directory
15+
unset -v latest
16+
for file in "$WOCHARTPATH"/*; do
17+
[[ $file -nt $latest ]] && latest=$file
18+
done
19+
20+
srctime="$(stat $mod_time_fmt $latest)"
21+
22+
out="$(helm package $WOCHARTPATH -d $SCRIPTPATH)"
623
helm_package=$(echo $out | cut -d ':' -f 2)
7-
helm repo index $SCRIPTPATH/charts/weblogic-operator/ --url https://oracle.github.io/weblogic-kubernetes-operator/charts
24+
helm_package_name=$(basename $helm_package)
25+
26+
dsttime="$(stat $mod_time_fmt $SCRIPTPATH/../docs/charts/$helm_package_name)"
27+
28+
if [ $srctime \> $dsttime ];
29+
then
30+
helm repo index $WOCHARTPATH/ --url https://oracle.github.io/weblogic-kubernetes-operator/charts
831

9-
cp $SCRIPTPATH/charts/weblogic-operator/index.yaml $SCRIPTPATH/../docs/charts
10-
mv $helm_package $SCRIPTPATH/../docs/charts/
32+
cp $WOCHARTPATH/index.yaml $SCRIPTPATH/../docs/charts
33+
mv $helm_package $SCRIPTPATH/../docs/charts/ -f
34+
else
35+
rm $helm_package
36+
fi;
1137

1238

0 commit comments

Comments
 (0)