File tree 5 files changed +126
-5
lines changed
5 files changed +126
-5
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu
2
+
3
+ COPY target/connect-kafka-linux-amd64 /connect-kafka
4
+
5
+ ENTRYPOINT ["/connect-kafka" ]
Original file line number Diff line number Diff line change @@ -5,4 +5,11 @@ build: main.go
5
5
clean :
6
6
@rm -rf target
7
7
8
- .PHONY : clean
8
+ docker :
9
+ @./package.sh linux > /dev/null
10
+ @docker build -t segment/connect-kafka . > /dev/null
11
+
12
+ docker-push : docker
13
+ @docker push segment/connect-kafka
14
+
15
+ .PHONY : clean docker
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Release: `ALPHA`
11
11
12
12
- Easily forward web, mobile, server analytics events to your Kafka instance
13
13
- Deploys in your infrastructure
14
- - Supports any Kafka cluster
14
+ - Supports any Kafka cluster
15
15
- Built with [ Heroku Kafka] ( https://www.heroku.com/kafka ) support in mind (with public/private space support)
16
16
- Deploys in 5 minutes
17
17
- Allows SSL (or not) connections
@@ -24,11 +24,26 @@ Release: `ALPHA`
24
24
25
25
### Connect to Kafka
26
26
27
+ Download ` connect-kafka ` using curl:
28
+
29
+ ``` bash
30
+ curl -s https://connect.segment.com.s3-us-west-2.amazonaws.com/connect-kafka-install.sh | sh
27
31
```
28
- go get -u github.com/segment-integrations/connect-kafka
32
+
33
+ If you just want the binary and install it yourself:
34
+
35
+ ``` bash
36
+ https://connect.segment.com.s3-us-west-2.amazonaws.com/connect-kafka-darwin-amd64
37
+ ```
38
+
39
+ You can also use Docker:
40
+
41
+ ``` bash
42
+ make docker
43
+ docker run segment/connect-kafka [...]
29
44
```
30
45
31
- You can connect to any internal Kafka deployment.
46
+ You can connect to any internal Kafka deployment.
32
47
33
48
```
34
49
$ connect-kafka -h
@@ -84,7 +99,7 @@ connect-kafka \
84
99
85
100
### via localtunnel
86
101
87
- You can open up a localtunnel on your local machine while you're testing:
102
+ You can open up a localtunnel on your local machine while you're testing:
88
103
89
104
```
90
105
npm install -g localtunnel
Original file line number Diff line number Diff line change
1
+ # Install Script
2
+ # Usage: curl -s $addr | sh
3
+
4
+ platform=' unknown'
5
+ host=' https://connect.segment.com.s3-us-west-2.amazonaws.com'
6
+ binary=' connect-kafka'
7
+ install_dir=' /usr/local/bin'
8
+ arch=' amd64'
9
+
10
+ if [[ " $OSTYPE " == " linux-gnu" ]]; then
11
+ platform=' linux'
12
+ elif [[ " $OSTYPE " == " darwin" * ]]; then
13
+ platform=' darwin'
14
+ elif [[ " $OSTYPE " == " cygwin" ]]; then
15
+ platform=' windows'
16
+ elif [[ " $OSTYPE " == " msys" ]]; then
17
+ platform=' windows'
18
+ elif [[ " $OSTYPE " == " win32" ]]; then
19
+ echo ' Platform is not supported!'
20
+ exit 1
21
+ elif [[ " $OSTYPE " == " freebsd" * ]]; then
22
+ platform=' freebsd'
23
+ else
24
+ echo ' Platform is not supported!'
25
+ exit 1
26
+ fi
27
+
28
+ echo " Installing $binary for $platform /$arch ..."
29
+ echo " Debug $host /$binary -$platform -$arch "
30
+
31
+ curl -s " $host /$binary -$platform -$arch " >> " $install_dir /$binary "
32
+ chmod +x $install_dir /$binary
33
+
34
+ size=$( wc -c < " $install_dir /$binary " )
35
+
36
+ echo " Size: $size "
37
+
38
+ echo " $binary was installed successfully to $install_dir "
Original file line number Diff line number Diff line change
1
+ # The more popular operating systems that Go supports.
2
+ platforms=(darwin openbsd freebsd linux)
3
+ arch=amd64
4
+ bucket=' connect.segment.com'
5
+ install=" install-connect-kafka.sh"
6
+ name=" connect-kafka"
7
+ host=' https://connect.segment.com.s3-us-west-2.amazonaws.com'
8
+
9
+ if hash gpg 2> /dev/null; then
10
+ echo ' gpg was found, skipping...'
11
+ else
12
+ echo ' gpg is not installed. Using homebrew to install it...'
13
+ brew install gpg
14
+ fi
15
+
16
+
17
+ build () {
18
+ local platform=$1
19
+
20
+ rm -rf target
21
+ mkdir -p target
22
+
23
+ echo " Building for $platform on $arch "
24
+ GOOS=$platform GOARCH=$arch go build -ldflags " -s -w" -o target/$name -$platform -$arch
25
+ }
26
+
27
+ build_all () {
28
+ for i in " ${platforms[@]} "
29
+ do
30
+ build $i
31
+ done
32
+ }
33
+
34
+ upload () {
35
+ echo " Uploading artifacts to s3..."
36
+
37
+ # Upload the targets to the production S3 bucket.
38
+ aws-vault exec production -- aws s3 cp target/ s3://$bucket / --recursive
39
+ aws-vault exec production -- aws s3 cp install.sh s3://$bucket /$install
40
+
41
+ echo " \n\nInstall script available at $host /$install "
42
+ echo " \nTo install, run:"
43
+ echo " -------------------------------------------"
44
+ echo " $ curl -s $host /$install | sh "
45
+ echo " -------------------------------------------"
46
+ }
47
+
48
+ case $1 in
49
+ linux)
50
+ build ' linux'
51
+ ;;
52
+ * )
53
+ build_all
54
+ upload
55
+ ;;
56
+ esac
You can’t perform that action at this time.
0 commit comments