Skip to content

Commit 830ba73

Browse files
author
Kamil Trzciński
committed
Compile pluginhook using docker image
1 parent 7380299 commit 830ba73

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

‎pluginhook/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pluginhook
2+
pluginhook.linux
23
package

‎pluginhook/Dockerfile‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:13.10
2+
3+
MAINTAINER Kamil Trzciński <ayufan@ayufan.eu>
4+
5+
RUN apt-get update
6+
RUN apt-get install -y curl gcc make g++ build-essential ca-certificates mercurial
7+
8+
RUN curl https://go.googlecode.com/files/go1.2.1.linux-amd64.tar.gz | tar -C / -xz
9+
10+
ENV PATH $PATH:/go/bin:/gocode/bin
11+
ENV GOPATH /gocode
12+
ENV GOROOT /go
13+
14+
ADD . /gocode
15+
WORKDIR /gocode
16+
17+
RUN go get code.google.com/p/go.crypto/ssh/terminal
18+
RUN go build -o pluginhook
19+
RUN GOOS=linux go build -o pluginhook.linux

‎pluginhook/Makefile‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ VERSION = 0.1.1
22

33
build: pluginhook
44

5-
pluginhook:
6-
go build -o pluginhook
7-
GOOS=linux go build -o pluginhook.linux
5+
install: pluginhook
6+
cp pluginhook /usr/local/bin/
7+
8+
pluginhook pluginhook.linux: pluginhook.go
9+
docker build -t progrium/pluginhook .
10+
docker run -t -rm progrium/pluginhook cat pluginhook > pluginhook.tmp
11+
docker run -t -rm progrium/pluginhook cat pluginhook.linux > pluginhook.linux.tmp
12+
mv pluginhook.tmp pluginhook
13+
mv pluginhook.linux.tmp pluginhook.linux
14+
docker rmi progrium/pluginhook
15+
chmod +x pluginhook pluginhook.linux
816

917
test: build
1018
PLUGIN_PATH=./tests/plugins BIN=./pluginhook tests/run_tests.sh
@@ -16,4 +24,4 @@ package: test build
1624
cd package && fpm -s dir -t deb -n pluginhook -v ${VERSION} --prefix /usr/local bin
1725

1826
release: package
19-
s3cmd -P put package/pluginhook_${VERSION}_amd64.deb s3://progrium-pluginhook
27+
s3cmd -P put package/pluginhook_${VERSION}_amd64.deb s3://progrium-pluginhook

0 commit comments

Comments
 (0)