Skip to content

Commit 6e4a39b

Browse files
committed
Create release tool
1 parent 89a580e commit 6e4a39b

File tree

2 files changed

+108
-1
lines changed

2 files changed

+108
-1
lines changed

backends/kubernetes/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Kubernetes Data Source
33
--------------------------------------
44

5-
Provides SQL Access to Kuberntes Rest API's
5+
Provides SQL Access to Kubernetes Rest API's
66

77
![mysql_kube](https://cloud.githubusercontent.com/assets/7269/20697265/96e13c10-b5ac-11e6-944b-c588c6e7570e.png)
88

@@ -12,7 +12,32 @@ Provides SQL Access to Kuberntes Rest API's
1212
**Types & Schema**
1313
* http://kubernetes.io/docs/api-reference/v1/definitions/
1414

15+
**Try It Out**
1516

17+
* **Assumes minikube is running locally**
18+
* Install dataux https://github.com/dataux/dataux/releases
19+
* Install dataux via docker
20+
21+
22+
```sh
23+
24+
minikube start
25+
26+
# install dataux https://github.com/dataux/dataux/releases
27+
# checkout/clone github.com/dataux/dataux to get a config file
28+
cd github.com/dataux/dataux
29+
30+
# run
31+
./dataux --config=backends/kubernetes/kubernetes.conf
32+
33+
34+
# from another terminal
35+
36+
mysql -h 127.0.0.1 -P 4000 -Dkube
37+
38+
39+
40+
```
1641
Testing & Dev
1742
-------------------------------------
1843

release.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
3+
# STEPS TO PERFORM RELEASE
4+
#
5+
# 1) ensure a new tag exists on github:
6+
# git tag -a 2016.12.03
7+
#
8+
# 2) update the "name" param in release below and any description
9+
# these are PER RELEASE
10+
#
11+
# 3) run release.sh
12+
#
13+
# https://github.com/aktau/github-release
14+
#
15+
# expects GITHUB_TOKEN in env
16+
#
17+
18+
19+
# show info on current release
20+
# github-release info -u dataux -r dataux
21+
22+
export GITHUB_USER="dataux"
23+
export GITHUB_REPO="dataux"
24+
25+
cd $GOPATH/src/github.com/dataux/dataux
26+
27+
dorelease() {
28+
echo "releasing $TAG"
29+
30+
# if we are re-running, lets delete it first
31+
github-release delete --tag $TAG
32+
33+
# create a release for tag
34+
github-release release \
35+
--tag $TAG \
36+
--name "Dataux $TAG release" \
37+
--description "
38+
download and save the binary and rename to dataux
39+
40+
\`\`\`
41+
# linux/amd64
42+
curl -Lo dataux https://github.com/dataux/dataux/releases/download/$TAG/dataux_linux.$TAG && chmod +x dataux && sudo mv dataux /usr/local/bin/
43+
44+
# OS X/amd64
45+
curl -Lo dataux https://github.com/dataux/dataux/releases/download/$TAG/dataux_mac.$TAG && chmod +x dataux && sudo mv dataux /usr/local/bin/
46+
47+
\`\`\`
48+
"
49+
50+
# https://github.com/dataux/dataux/releases/download/2016.12.03/dataux_linux.2016.12.03
51+
52+
# do the linux release
53+
echo "Creating and uploading linux dataux"
54+
go build
55+
56+
echo "Now uploading $TAG linux version"
57+
github-release upload \
58+
--tag $TAG \
59+
--label "Dataux linux $TAG" \
60+
--name "dataux_linux.$TAG" \
61+
--file dataux
62+
63+
# create a build for the mac osx amd64 binary
64+
echo "Creating and uploading mac dataux"
65+
env GOOS=darwin GOARCH=amd64 go build
66+
67+
echo "Now uploading $TAG mac version"
68+
github-release upload \
69+
--tag $TAG \
70+
--label "Dataux mac $TAG" \
71+
--name "dataux_mac.$TAG" \
72+
--file dataux
73+
74+
}
75+
76+
# lets get the name of this release which is our tag
77+
# aka 2016.12.03 type tag
78+
export TAG=$(git describe $(git rev-list --tags --max-count=1))
79+
dorelease
80+
81+
export TAG="latest"
82+
dorelease

0 commit comments

Comments
 (0)