forked from kubernetes-up-and-running/kuard
-
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
9 changed files
with
452 additions
and
0 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 |
---|---|---|
|
@@ -22,3 +22,9 @@ _testmain.go | |
*.exe | ||
*.test | ||
*.prof | ||
|
||
/bin | ||
/.go | ||
/.*-push | ||
/.*-container | ||
/.*-dockerfile |
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,20 @@ | ||
# Copyright 2017 The KUAR Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM ARG_FROM | ||
|
||
ADD bin/ARG_FAKEVER/ARG_ARCH/ARG_BIN /ARG_BIN | ||
|
||
USER nobody:nobody | ||
ENTRYPOINT ["/ARG_BIN"] |
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,52 @@ | ||
# Copyright 2016 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# | ||
# `make help` will show commonly used targets. | ||
# | ||
|
||
# We don't need make's built-in rules. | ||
MAKEFLAGS += --no-builtin-rules | ||
.SUFFIXES: | ||
|
||
# Golang package. | ||
PKG := github.com/jbeda/kuard | ||
|
||
# List of binaries to build. You must have a matching Dockerfile.BINARY | ||
# for each BINARY. | ||
BINARIES := kuard | ||
|
||
# Registry to push to. | ||
REGISTRY ?= gcr.io/kuar-demo/kuard | ||
|
||
# Default architecture to build for. | ||
ARCH ?= amd64 | ||
|
||
# Image to use for building. | ||
BUILD_IMAGE ?= golang:1.7-alpine | ||
|
||
# For demo purposes, we want to build multiple versions. They will all be | ||
# mostly the same but will let us demonstrate rollouts. | ||
FAKE_VERSIONS = a b c | ||
|
||
# This is the real version. We'll grab it from git and use tags. | ||
VERSION_BASE ?= $(shell git describe --tags --always --dirty) | ||
# This version-strategy uses a manual value to set the version string | ||
#VERSION := 1.2.3 | ||
|
||
# Set to 1 to print more verbose output from the build. | ||
VERBOSE ?= 0 | ||
|
||
# Include standard build rules. | ||
include rules.mk |
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 @@ | ||
A demo application for "Kubernetes Up and Running". | ||
|
||
--- | ||
|
||
Go building template stuff taken from | ||
https://github.com/thockin/go-build-template with an Apache 2.0 license. | ||
Handling multiple targets taken from https://github.com/bowei/go-build-template. |
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,40 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2016 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
if [ -z "${PKG}" ]; then | ||
echo "PKG must be set" | ||
exit 1 | ||
fi | ||
if [ -z "${ARCH}" ]; then | ||
echo "ARCH must be set" | ||
exit 1 | ||
fi | ||
if [ -z "${VERSION}" ]; then | ||
echo "VERSION must be set" | ||
exit 1 | ||
fi | ||
|
||
export CGO_ENABLED=0 | ||
export GOARCH="${ARCH}" | ||
|
||
go install \ | ||
-installsuffix "static" \ | ||
-ldflags "-X ${PKG}/pkg/version.VERSION=${VERSION}" \ | ||
./... |
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,52 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2016 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
export CGO_ENABLED=0 | ||
|
||
TARGETS=$(for d in "$@"; do echo ./$d/...; done) | ||
|
||
echo "Running tests:" | ||
go test -i -installsuffix "static" ${TARGETS} | ||
go test -installsuffix "static" ${TARGETS} | ||
echo | ||
|
||
echo -n "Checking gofmt: " | ||
ERRS=$(find "$@" -type f -name \*.go | xargs gofmt -l 2>&1 || true) | ||
if [ -n "${ERRS}" ]; then | ||
echo "FAIL - the following files need to be gofmt'ed:" | ||
for e in ${ERRS}; do | ||
echo " $e" | ||
done | ||
echo | ||
exit 1 | ||
fi | ||
echo "PASS" | ||
echo | ||
|
||
echo -n "Checking go vet: " | ||
ERRS=$(go vet ${TARGETS} 2>&1 || true) | ||
if [ -n "${ERRS}" ]; then | ||
echo "FAIL" | ||
echo "${ERRS}" | ||
echo | ||
exit 1 | ||
fi | ||
echo "PASS" | ||
echo |
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,27 @@ | ||
/* | ||
Copyright 2017 The KUAR Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/jbeda/kuard/pkg/version" | ||
) | ||
|
||
func main() { | ||
log.Printf("Starting kuard version: %v", version.VERSION) | ||
} |
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,19 @@ | ||
/* | ||
Copyright 2017 The KUAR Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package version | ||
|
||
var VERSION = "UNKNOWN" |
Oops, something went wrong.