-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Golang CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-go/ for more details | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
# specify the version | ||
- image: circleci/golang:1.10 | ||
|
||
# Specify service dependencies here if necessary | ||
# CircleCI maintains a library of pre-built images | ||
# documented at https://circleci.com/docs/2.0/circleci-images/ | ||
# - image: circleci/postgres:9.4 | ||
|
||
#### TEMPLATE_NOTE: go expects specific checkout path representing url | ||
#### expecting it in the form of | ||
#### /go/src/github.com/circleci/go-tool | ||
#### /go/src/bitbucket.org/circleci/go-tool | ||
working_directory: /go/src/github.com/aylei/kubectl-debug | ||
environment: | ||
- GOCACHE: "/tmp/go/cache" | ||
- DEP_VERSION: 0.4.1 | ||
steps: | ||
- checkout | ||
|
||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
|
||
# try to restore cache | ||
- restore_cache: | ||
key: gopkg-{{ .Branch }}-{{ checksum "Gopkg.lock" }} | ||
paths: | ||
- /go/src/github.com/aylei/kubectl-debug/vendor | ||
|
||
# install dep and do dep ensure | ||
- run: | ||
name: dep-ensure | ||
command: | | ||
if [ ! -d /go/src/github.com/aylei/kubectl-debug/vendor ]; then | ||
curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o /go/bin/dep | ||
chmod +x /go/bin/dep | ||
/go/bin/dep ensure | ||
fi | ||
- save_cache: | ||
key: gopkg-{{ .Branch }}-{{ checksum "Gopkg.lock" }} | ||
paths: | ||
- /go/src/github.com/aylei/kubectl-debug/vendor | ||
|
||
# cache for build | ||
- restore_cache: | ||
keys: | ||
- build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }} | ||
paths: | ||
- /tmp/go/cache | ||
|
||
- run: GOOS=linux GARCH=amd64 go build -o debug-agent ./cmd/agent | ||
|
||
- deploy: | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
docker build . -t aylei/debug-agent | ||
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} https://index.docker.io/v1/ | ||
docker push aylei/debug-agent | ||
- save_cache: | ||
key: build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }} | ||
paths: | ||
- /tmp/go/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!debug-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
.cache | ||
*.output | ||
.swp | ||
vendor/ | ||
vendor/ | ||
debug-agent | ||
kubectl-debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM alpine:3.4 | ||
RUN apk add --update --no-cache ca-certificates && rm /var/cache/apk/* | ||
|
||
COPY ./debug-agent /bin/debug-agent | ||
EXPOSE 10027 | ||
|
||
ENTRYPOINT ["/bin/debug-agent"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters