forked from replicatedhq/kURL
-
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.
* Kurl util image * fix make task for building templates * test deploy * reverr testing Co-authored-by: Andrew Reed <[email protected]>
- Loading branch information
Showing
22 changed files
with
666 additions
and
50 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
function require() { | ||
if [ -z "$2" ]; then | ||
echo "validation failed: $1 unset" | ||
exit 1 | ||
fi | ||
} | ||
|
||
require WORKDIR "${WORKDIR}" | ||
require DOCKERFILE "${DOCKERFILE}" | ||
|
||
set -veuo pipefail | ||
|
||
docker build -f ${DOCKERFILE} \ | ||
--build-arg version=${CIRCLE_SHA1:0:7} \ | ||
--build-arg KURL_UTIL_IMAGE \ | ||
-t ${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1:0:7} \ | ||
${WORKDIR:-$HOME/repo} |
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,24 @@ | ||
#!/bin/bash | ||
|
||
# Generate and export the kurl util image reference. | ||
|
||
set -eo pipefail | ||
|
||
function image_export() { | ||
local prev_setu="${-//[^u]/}" | ||
|
||
set +u | ||
|
||
local tag=alpha | ||
if [ -n "$CIRCLE_TAG" ]; then | ||
tag="$CIRCLE_TAG" | ||
elif [ "$CIRCLE_BRANCH" = "beta" ]; then | ||
tag="beta" | ||
fi | ||
|
||
export KURL_UTIL_IMAGE=replicated/kurl-util:$tag | ||
|
||
if [ -n "$prev_setu" ]; then set -u; fi | ||
} | ||
|
||
image_export |
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,3 @@ | ||
/bin/ | ||
*DS_Store | ||
/vendor/ |
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,58 @@ | ||
SHELL := /bin/bash | ||
KURL_UTIL_IMAGE ?= replicated/kurl-util:alpha | ||
|
||
export GO111MODULE=on | ||
|
||
GIT_TREE = $(shell git rev-parse --is-inside-work-tree 2>/dev/null) | ||
ifneq "$(GIT_TREE)" "" | ||
define GIT_UPDATE_INDEX_CMD | ||
git update-index --assume-unchanged | ||
endef | ||
define GIT_SHA | ||
`git rev-parse HEAD` | ||
endef | ||
else | ||
define GIT_UPDATE_INDEX_CMD | ||
echo "Not a git repo, skipping git update-index" | ||
endef | ||
define GIT_SHA | ||
"" | ||
endef | ||
endif | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ./bin | ||
|
||
.PHONY: deps | ||
deps: | ||
go get golang.org/x/lint/golint | ||
|
||
.PHONY: lint | ||
lint: | ||
golint -set_exit_status ./... | ||
|
||
.PHONY: vet | ||
vet: | ||
go vet ./... | ||
|
||
.PHONY: test | ||
test: lint vet | ||
go test ./cmd/... | ||
|
||
.PHONY: build | ||
build: bin/yamlutil bin/subnet | ||
|
||
bin/yamlutil: | ||
go build -o bin/yamlutil cmd/yamlutil/main.go | ||
|
||
bin/subnet: | ||
go build -o bin/subnet cmd/subnet/main.go | ||
|
||
.PHONY: kurl-util-image | ||
kurl-util-image: | ||
docker build -t $(KURL_UTIL_IMAGE) -f deploy/Dockerfile --build-arg commit="${GIT_SHA}" . | ||
|
||
.PHONY: build-and-push-kurl-util-image | ||
build-and-push-kurl-util-image: kurl-util-image | ||
docker push $(KURL_UTIL_IMAGE) |
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 @@ | ||
# kURL Utility Image | ||
|
||
Utility image for kURL clusters. | ||
|
||
## Test manually | ||
|
||
run `make kurl-util-image`. |
Oops, something went wrong.