-
Notifications
You must be signed in to change notification settings - Fork 0
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
1,334 changed files
with
495,689 additions
and
102 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,46 @@ | ||
version: 2 | ||
defaults: &defaults | ||
working_directory: /go/src/github.com/foxdalas/cfssl-kube | ||
docker: | ||
- image: circleci/golang:1.9.1 | ||
environment: | ||
DOCKER_IMAGE_NAME: foxdalas/cfssl-kube | ||
QUAY_IMAGE_NAME: quay.io/foxdalas/cfssl-kube | ||
REPO_PATH: cfssl-kube | ||
|
||
jobs: | ||
build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Build Project | ||
command: | | ||
make build | ||
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD | ||
BUILD_TAG="build" | ||
GIT_COMMIT=`git rev-parse HEAD` | ||
GIT_TAGS=`git tag --contains $GIT_COMMIT` | ||
DOCKER_IMAGE="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" | ||
if [[ $GIT_TAGS = "" ]] | ||
then | ||
IMAGE_TAGS="canary" | ||
else | ||
IMAGE_TAGS=`echo -e "$GIT_TAGS\nlatest"` | ||
fi | ||
make image | ||
for tag in $IMAGE_TAGS; do | ||
echo $tag | ||
docker tag $DOCKER_IMAGE:$BUILD_TAG $DOCKER_IMAGE:$tag | ||
docker push $DOCKER_IMAGE:$tag | ||
done | ||
cp Dockerfile _build/ | ||
cp Makefile _build/ | ||
docker images | ||
- store_artifacts: | ||
path: /go/src/github.com/foxdalas/cfssl-kube/_build | ||
destination: cfssl-kube | ||
- persist_to_workspace: | ||
root: /go/src/github.com/foxdalas | ||
paths: cfssl-kube |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine:3.5 | ||
MAINTAINER Maxim Pogozhiy <[email protected]> | ||
|
||
RUN addgroup -g 1000 app && \ | ||
adduser -G app -h /home/app -u 1000 -D app | ||
|
||
USER app | ||
WORKDIR /home/app | ||
|
||
COPY _build/cfssl-kube-linux-amd64 /cfssl-kube | ||
ENTRYPOINT ["/cfssl-kube"] | ||
|
||
ARG VCS_REF | ||
LABEL org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="https://github.com/foxdalas/cfssl-kube" \ | ||
org.label-schema.license="Apache-2.0" |
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,62 @@ | ||
ACCOUNT=foxdalas | ||
APP_NAME=cfssl-kube | ||
|
||
PACKAGE_NAME=github.com/${ACCOUNT}/${APP_NAME} | ||
GO_VERSION=1.9.1 | ||
|
||
GOOS := linux | ||
GOARCH := amd64 | ||
|
||
DOCKER_IMAGE=${ACCOUNT}/${APP_NAME} | ||
|
||
BUILD_DIR=_build | ||
TEST_DIR=_test | ||
|
||
CONTAINER_DIR=/go/src/${PACKAGE_NAME} | ||
|
||
BUILD_TAG := build | ||
IMAGE_TAGS := canary | ||
|
||
PACKAGES=$(shell find . -name "*_test.go" | xargs -n1 dirname | grep -v 'vendor/' | sort -u | xargs -n1 printf "%s.test_pkg ") | ||
|
||
.PHONY: version | ||
|
||
all: test build | ||
|
||
depend: | ||
rm -rf $(TEST_DIR)/ | ||
rm -rf ${BUILD_DIR}/ | ||
mkdir $(TEST_DIR)/ | ||
mkdir $(BUILD_DIR)/ | ||
|
||
version: | ||
$(eval GIT_STATE := $(shell if test -z "`git status --porcelain 2> /dev/null`"; then echo "clean"; else echo "dirty"; fi)) | ||
$(eval GIT_COMMIT := $(shell git rev-parse HEAD)) | ||
$(eval APP_VERSION ?= $(shell cat VERSION)) | ||
@echo $(APP_VERSION) | ||
|
||
%.test_pkg: test_prepare | ||
$(eval PKG := ./$*) | ||
$(eval PKG_CLEAN := $(shell echo "$*" | sed "s#^p#.p#" | sed "s#/#-#g")) | ||
@echo "test $(PKG_CLEAN) ($(PKG))" | ||
bash -o pipefail -c "go test -v -coverprofile=$(TEST_DIR)/coverage$(PKG_CLEAN).txt -covermode count $(PKG) | tee $(TEST_DIR)/test$(PKG_CLEAN).out" | ||
cat $(TEST_DIR)/test$(PKG_CLEAN).out | go2xunit > $(TEST_DIR)/test$(PKG_CLEAN).xml | ||
gocover-cobertura < $(TEST_DIR)/coverage$(PKG_CLEAN).txt > $(TEST_DIR)/coverage$(PKG_CLEAN).xml | ||
|
||
build: depend version | ||
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \ | ||
-a -tags netgo \ | ||
-o ${BUILD_DIR}/${APP_NAME}-$(GOOS)-$(GOARCH) \ | ||
-ldflags "-X main.AppGitState=${GIT_STATE} -X main.AppGitCommit=${GIT_COMMIT} -X main.AppVersion=${APP_VERSION}" | ||
|
||
docker: | ||
|
||
image: version | ||
docker build --build-arg VCS_REF=$(GIT_COMMIT) -t $(DOCKER_IMAGE):$(BUILD_TAG) . | ||
|
||
push: image | ||
set -e; \ | ||
for tag in $(IMAGE_TAGS); do \ | ||
docker tag $(DOCKER_IMAGE):$(BUILD_TAG) $(DOCKER_IMAGE):$${tag} ; \ | ||
docker push $(DOCKER_IMAGE):$${tag}; \ | ||
done |
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,6 @@ | ||
# cfssl-kube | ||
CFSSL Certificates generator for Kubernetes | ||
|
||
[![Docker Repository on Quay](https://quay.io/repository/foxdalas/cfssl-kube/status "Docker Repository on Quay")](https://quay.io/repository/foxdalas/cfssl-kube) | ||
[![Docker Pulls](https://img.shields.io/docker/pulls/foxdalas/cfssl-kube.svg?maxAge=604800)](https://hub.docker.com/r/foxdalas/cfssl-kube/) | ||
[![CircleCI](https://circleci.com/gh/foxdalas/cfssl-kube.svg?style=svg)](https://circleci.com/gh/foxdalas/cfssl-kube) |
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 @@ | ||
0.0.1-dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ func (cf *CFKube) InitKube() error { | |
|
||
func (cf *CFKube) Namespace() string { | ||
return cf.cfNamespace | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ func (cf *CFKube) WatchReconfigure() { | |
cf.workQueue.Done(item) | ||
} | ||
}() | ||
} | ||
} |
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
Oops, something went wrong.