forked from monasca/monasca-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.sh
executable file
·57 lines (44 loc) · 1.14 KB
/
push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -ex
REPO=$(git config remote.origin.url)
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
# Set up git config
git config --global user.email "monasca@lists.launchpad.net"
git config --global user.name "Monasca CI"
# Initialize Helm
./helm init -c
# Build Helm Charts
./helm repo add monasca http://monasca.io/monasca-helm/
for chart in "$@"
do
./helm dependency update "$chart"
./helm package "$chart"
done
# clone repo to make changes in
git clone $REPO out
cd out
git checkout gh-pages
cd ..
# copy over packages
cp *.tgz out/.
# Update index file
cd out
../helm repo index . --url http://monasca.io/monasca-helm/
# Commit changes
git add *.tgz
git add index.yaml
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
# Set up key to push
set +x
openssl aes-256-cbc -K $encrypted_c04b32b34bc7_key -iv $encrypted_c04b32b34bc7_iv -in ../deploy-key.enc -out ../deploy-key -d
chmod 600 ../deploy-key
eval "$(ssh-agent -s)"
ssh-add ../deploy-key
# Push Changes
git push "$SSH_REPO" gh-pages
# Remove out directory
cd ..
rm -rf out
git checkout -- .
# check out master branch again to create pull requests
git status