Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit a7501f1

Browse files
authored
Streamlined the chart publish secret (#2852)
1 parent 2fe0ea3 commit a7501f1

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,8 @@ jobs:
143143
- stage: push-chart
144144
script:
145145
- |
146-
openssl aes-256-cbc -K $encrypted_99eda037369e_key -iv $encrypted_99eda037369e_iv -in contrib/hack/ci/assets/chart_key.enc -out chart_key -d
146+
set -e
147+
openssl aes-256-cbc -K $encrypted_99eda037369e_key -iv $encrypted_99eda037369e_iv -in \
148+
contrib/hack/ci/assets/chart_key.enc -out contrib/hack/ci/assets/chart_key -d
149+
chmod 400 contrib/hack/ci/assets/chart_key
147150
contrib/hack/ci/publish-helm-chart.sh

contrib/hack/ci/assets/chart_key.enc

-768 Bytes
Binary file not shown.

contrib/hack/ci/publish-helm-chart.sh

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ reconfigure_git() {
6666
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
6767
git fetch --all
6868
git config remote.origin.url "$(git config --get remote.origin.url | sed 's/https:\/\/github.com\//[email protected]:/')"
69-
chmod 600 chart_key
70-
git config --local core.sshCommand "/usr/bin/ssh -i $(pwd)/chart_key"
69+
git config --local core.sshCommand "/usr/bin/ssh -i ${CURRENT_DIR}/assets/chart_key"
7170
}
7271

7372
publish() {
@@ -78,17 +77,17 @@ publish() {
7877
cp index.yaml "${TEMP_CHART_DIR}"
7978

8079
pushd "${TEMP_CHART_DIR}"
81-
helm repo index --url "${SVC_CATALOG_REPO_URL}" --merge ./index.yaml .
82-
sed 's/\.tgz$/.tgz?raw=true/' ./index.yaml > ../index.yaml
83-
git add ../index.yaml
84-
for package in **/*.tgz; do
85-
dest_dir="../charts_archive/${package/\/[a-z0-9.-]*tgz/}"
86-
mkdir -p "$dest_dir"
87-
mv "$package" "../charts_archive/${dest_dir}/"
88-
git add "../charts_archive/${package}"
89-
done
90-
git commit -m "$COMMIT_MESSAGE"
91-
git push
80+
helm repo index --url "${SVC_CATALOG_REPO_URL}" --merge ./index.yaml .
81+
sed 's/\.tgz$/.tgz?raw=true/' ./index.yaml >../index.yaml
82+
git add ../index.yaml
83+
for package in **/*.tgz; do
84+
dest_dir="../charts_archive/${package/\/[a-z0-9.-]*tgz/}"
85+
mkdir -p "$dest_dir"
86+
mv "$package" "../charts_archive/${dest_dir}/"
87+
git add "../charts_archive/${package}"
88+
done
89+
git commit -m "$COMMIT_MESSAGE"
90+
git push
9291
popd
9392
}
9493

0 commit comments

Comments
 (0)