@@ -35,6 +35,18 @@ pushTags() {
35
35
done
36
36
}
37
37
38
+ # Adds an Chart to a github release
39
+ uploadChart () {
40
+ chart=$1
41
+ version=$2
42
+ token=$3
43
+
44
+ helm dependency update " kubernetes/${chart} "
45
+ helm package " kubernetes/${chart} "
46
+ curl -v -H " Authorization: token $token " -H " Content-Type: application/zip" --data-binary @${chart} -${version} .tgz " https://api.github.com/repos/gchq/gaffer-docker/releases/tag/v${version} /assets"
47
+ rm ${chart} -${version} .tgz
48
+ }
49
+
38
50
# If branch is not master or is pull request, exit
39
51
if [ " ${TRAVIS_PULL_REQUEST} " != " false" ] || [ " ${TRAVIS_BRANCH} " != " master" ]; then
40
52
exit 0
@@ -66,7 +78,7 @@ git config --global credential.helper "store --file=.git/credentials"
66
78
echo " https://${GITHUB_TOKEN} :@github.com" > .git/credentials
67
79
68
80
# Add Develop branch
69
- git remote set-branches --add origin develop
81
+ git remote set-branches --add origin develop gh-pages
70
82
git pull
71
83
72
84
# Tag release in Git
@@ -79,22 +91,26 @@ REPO_NAME="Gaffer-Docker"
79
91
JSON_DATA=" {
80
92
\" tag_name\" : \" ${TAG_NAME} \" ,
81
93
\" name\" : \" ${REPO_NAME} ${APP_VERSION} \" ,
82
- \" body\" : \" [${APP_VERSION} headliners](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Aheadliner)
83
-
84
- [${APP_VERSION} enhancements](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Aenhancement)
85
-
86
- [${APP_VERSION} bugs fixed](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Abug)
87
-
88
- [${APP_VERSION} migration notes](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Amigration-required)
89
-
90
- [${APP_VERSION} all issues resolved](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} )\" ,
94
+ \" body\" : \" [${APP_VERSION} headliners](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Aheadliner)\n\n[${APP_VERSION} enhancements](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Aenhancement)\n\n[${APP_VERSION} bugs fixed](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Abug)\n\n[${APP_VERSION} migration notes](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} +label%3Amigration-required)\n\n[${APP_VERSION} all issues resolved](https://github.com/gchq/${REPO_NAME} /issues?q=milestone%3A${TAG_NAME} )\" ,
91
95
\" draft\" : false
92
96
}"
93
97
echo " ${JSON_DATA} "
94
- curl -v --data " ${JSON_DATA} " https://api.github.com/repos/gchq/" ${REPO_NAME} " /releases? access_token= " ${GITHUB_TOKEN} "
98
+ curl -v --data " ${JSON_DATA} " -H " Authorization: token ${GITHUB_TOKEN} " " https://api.github.com/repos/gchq/${REPO_NAME} /releases"
95
99
96
100
# Update version on develop
97
101
git checkout develop
98
102
./cd/update_app_version.sh
99
103
git commit -a -m " Updated App version"
100
104
git push
105
+
106
+ # Upload Charts to Github releases
107
+ uploadChart hdfs " ${APP_VERSION} " " ${GITHUB_TOKEN} "
108
+ uploadChart gaffer " ${APP_VERSION} " " ${GITHUB_TOKEN} "
109
+ uploadChart gaffer-road-traffic " ${APP_VERSION} " " ${GITHUB_TOKEN} "
110
+
111
+ # Update gh-pages
112
+ git checkout gh-pages
113
+ git merge master -m " Updated docs to latest version"
114
+ helm repo index . --url " https://github.com/gchq/gaffer-docker/releases/tag/${TAG_NAME} " --merge index.yaml
115
+ git commit -am " Updated index.yaml"
116
+ git push
0 commit comments