Merge 806343319db7eea60cfcff4c9ebc2c0ec8150764 into 838f58e648b30bbf2ee2b9351fdf92bd1eb6a333

This commit is contained in:
Scott Miller 2016-07-09 18:37:25 +00:00 committed by GitHub
commit e27aea6617
4 changed files with 24 additions and 9 deletions

1
.gitignore vendored
View File

@ -2,5 +2,6 @@
host_key
host_key.pub
ssh-chat
id_rsa
*.log
.*

View File

@ -1,3 +1,7 @@
sudo: required
services:
- docker
language: go
notifications:
@ -12,6 +16,15 @@ install:
script:
# TODO: Bring this back: - fgt golint
- make test
- ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
- cp ~/.ssh/id_rsa id_rsa
- docker build -t "$DOCKER_USER"/ssh-chat:latest .
deploy:
provider: script
script: ./docker-deploy.sh
on:
branch: master
go:
- 1.4
- tip

View File

@ -3,16 +3,13 @@
# $ docker build -t ssh-chat .
# $ docker run -d -p 0.0.0.0:(your host machine port):2022 --name ssh-chat ssh-chat
#
FROM golang:1.4
FROM scratch
MAINTAINER Alvin Lai <al@alvinlai.com>
RUN apt-get update
RUN apt-get install -y openssh-client
RUN go get github.com/shazow/ssh-chat
RUN ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
ADD ssh-chat ssh-chat
ADD id_rsa id_rsa
EXPOSE 2022
CMD ["-i", "/root/.ssh/id_rsa", "-vv", "--bind", "\":2022\""]
ENTRYPOINT ["ssh-chat"]
CMD ["/ssh-chat", "-i", "id_rsa", "-vv", "--bind", "\":2022\""]
# ENTRYPOINT ["ssh-chat"]

4
docker-deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -ex
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-X main.buildCommit `git describe --long --tags --dirty --always`" ./cmd/ssh-chat
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker push $DOCKER_USER/ssh-chat:latest