Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/github.com/kevinburke/go-bindata/testdata/symlinkRecursiveParent/symlinkTarget
vendor/github.com/coreos/etcd/cmd/etcd
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Include git version info
build --workspace_status_command hack/print-workspace-status.sh
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
/.kube/
.bundle
.kube
/bazel-*
/apiserver.local.config
/_output/
/_release/
4 changes: 4 additions & 0 deletions .kazelcfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"GoPrefix": "github.com/jetstack/tarmak",
"AddSourcesRules": true
}
12 changes: 12 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@bazel_gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/jetstack/tarmak
# gazelle:proto disable_global
# gazelle:exclude pkg/tarmak/assets
# gazelle:exclude pkg/tarmak/binaries
# gazelle:exclude vendor/github.com/hashicorp/go-rootcerts
gazelle(
name = "gazelle",
external = "vendored",
command = "fix",
)
61 changes: 55 additions & 6 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ required = [
"github.com/kubernetes-incubator/reference-docs/gen-apidocs",
"github.com/golang/mock/mockgen",
"github.com/kevinburke/go-bindata/go-bindata",
"github.com/tcnksm/ghr"
]

[[constraint]]
name = "github.com/tcnksm/ghr"
version = "0.12.0"

[[constraint]]
name = "github.com/fsouza/go-dockerclient"
version = "1.0"
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ help1:

all: verify test build ## runs verify, test and build targets

depend: $(BINDIR)/go-bindata $(BINDIR)/mockgen $(BINDIR)/defaulter-gen $(BINDIR)/defaulter-gen $(BINDIR)/deepcopy-gen $(BINDIR)/conversion-gen $(BINDIR)/client-gen $(BINDIR)/lister-gen $(BINDIR)/informer-gen $(BINDIR)/dep $(BINDIR)/goreleaser $(BINDIR)/upx $(BINDIR)/openapi-gen $(BINDIR)/gen-apidocs $(BINDIR)/node ## download all dependencies necessary for build
depend: $(BINDIR)/go-bindata $(BINDIR)/mockgen $(BINDIR)/defaulter-gen $(BINDIR)/defaulter-gen $(BINDIR)/deepcopy-gen $(BINDIR)/conversion-gen $(BINDIR)/client-gen $(BINDIR)/lister-gen $(BINDIR)/informer-gen $(BINDIR)/dep $(BINDIR)/goreleaser $(BINDIR)/upx $(BINDIR)/openapi-gen $(BINDIR)/gen-apidocs $(BINDIR)/node $(BINDIR)/ghr ## download all dependencies necessary for build

verify: generate go_verify verify_boilerplate verify_codegen verify_vendor verify_gen_docs ## verifies generated files & scripts

Expand Down Expand Up @@ -110,6 +110,10 @@ $(BINDIR)/mockgen:
mkdir -p $(BINDIR)
go build -o $(BINDIR)/mockgen ./vendor/github.com/golang/mock/mockgen

$(BINDIR)/ghr:
mkdir -p $(BINDIR)
go build -o $@ ./vendor/github.com/tcnksm/ghr

$(BINDIR)/go-bindata:
mkdir -p $(BINDIR)
go build -o $(BINDIR)/go-bindata ./vendor/github.com/kevinburke/go-bindata/go-bindata
Expand Down Expand Up @@ -156,10 +160,10 @@ $(BINDIR)/npm: $(BINDIR)/node
# upx binary packer, only supported on Linux
$(BINDIR)/upx:
ifeq ($(UNAME_S),Linux)
curl -sL -o [email protected] https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
echo "e1fc0d55c88865ef758c7e4fabbc439e4b5693b9328d219e0b9b3604186abe20 [email protected]" | $(SHASUM)
curl -sL -o [email protected] https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz
echo "b5d6856b89dd696138ad8c7245a8f0dae4b76f41b5a31c7c43a21bc72c479c4e [email protected]" | $(SHASUM)
which xz || ( apt-get update && apt-get -y install xz-utils)
cd $(BINDIR) && tar xvf $(shell basename $@).tar.xz upx-3.94-amd64_linux/upx --strip-components=1
cd $(BINDIR) && tar xvf $(shell basename $@).tar.xz upx-3.95-amd64_linux/upx --strip-components=1
rm [email protected]
else
echo -e "#/bin/sh\nexit 0" > $@
Expand Down
40 changes: 40 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.6/rules_go-0.16.6.tar.gz",
sha256 = "ade51a315fa17347e5c31201fdc55aa5ffb913377aa315dceb56ee9725e620ee",
)

http_archive(
name = "bazel_gazelle",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.16.0/bazel-gazelle-0.16.0.tar.gz"],
sha256 = "7949fc6cc17b5b191103e97481cf8889217263acf52e00b560683413af204fcb",
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")

go_rules_dependencies()

go_register_toolchains(
go_version = "1.10.8",
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

gazelle_dependencies()

## Install dep for dependency management
http_file(
name = "dep_darwin",
executable = 1,
sha256 = "1a7bdb0d6c31ecba8b3fd213a1170adf707657123e89dff234871af9e0498be2",
urls = ["https://github.com/golang/dep/releases/download/v0.5.0/dep-darwin-amd64"],
)

http_file(
name = "dep_linux",
executable = 1,
sha256 = "287b08291e14f1fae8ba44374b26a2b12eb941af3497ed0ca649253e21ba2f83",
urls = ["https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64"],
)
28 changes: 28 additions & 0 deletions cmd/tagging_control/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//pkg/version:def.bzl", "version_x_defs")

go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/jetstack/tarmak/cmd/tagging_control",
visibility = ["//visibility:private"],
deps = ["//cmd/tagging_control/cmd:go_default_library"],
)

go_binary(
name = "tagging_control",
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
x_defs = version_x_defs(),
)

go_binary(
name = "tagging_control_linux_amd64",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
x_defs = version_x_defs(),
goos = "linux",
goarch = "amd64",
pure = "on",
)
18 changes: 18 additions & 0 deletions cmd/tagging_control/cmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"handle.go",
"root.go",
"version.go",
],
importpath = "github.com/jetstack/tarmak/cmd/tagging_control/cmd",
visibility = ["//visibility:public"],
deps = [
"//pkg/tagging_control:go_default_library",
"//pkg/version:go_default_library",
"//vendor/github.com/aws/aws-lambda-go/lambda:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
],
)
30 changes: 30 additions & 0 deletions cmd/tarmak/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//pkg/version:def.bzl", "version_x_defs")

go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/jetstack/tarmak/cmd/tarmak",
visibility = ["//visibility:private"],
deps = ["//cmd/tarmak/cmd:go_default_library"],
)

go_binary(
name = "tarmak_linux_amd64",
embed = [":go_default_library"],
pure = "on",
goos = "linux",
goarch = "amd64",
visibility = ["//visibility:public"],
x_defs = version_x_defs(),
)

go_binary(
name = "tarmak_darwin_amd64",
embed = [":go_default_library"],
pure = "on",
goos = "darwin",
goarch = "amd64",
visibility = ["//visibility:public"],
x_defs = version_x_defs(),
)
63 changes: 63 additions & 0 deletions cmd/tarmak/cmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"cluster.go",
"cluster_apply.go",
"cluster_debug.go",
"cluster_debug_puppet.go",
"cluster_debug_puppet_build-tar.go",
"cluster_debug_terraform.go",
"cluster_debug_terraform_shell.go",
"cluster_destroy.go",
"cluster_force-unlock.go",
"cluster_images.go",
"cluster_images_build.go",
"cluster_images_list.go",
"cluster_init.go",
"cluster_instances.go",
"cluster_instances_list.go",
"cluster_instances_ssh.go",
"cluster_kubeconfig.go",
"cluster_kubectl.go",
"cluster_list.go",
"cluster_plan.go",
"cluster_set-current.go",
"cluster_ssh.go",
"environment.go",
"environment_init.go",
"environment_list.go",
"init.go",
"kubeconfig.go",
"kubectl.go",
"provider.go",
"provider_init.go",
"provider_list.go",
"provider_validate.go",
"root.go",
"terraform.go",
"version.go",
],
importpath = "github.com/jetstack/tarmak/cmd/tarmak/cmd",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/cluster/v1alpha1:go_default_library",
"//pkg/apis/tarmak/v1alpha1:go_default_library",
"//pkg/tarmak:go_default_library",
"//pkg/tarmak/utils:go_default_library",
"//pkg/tarmak/utils/consts:go_default_library",
"//pkg/terraform:go_default_library",
"//pkg/version:go_default_library",
"//vendor/github.com/sirupsen/logrus:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = ["tarmak_test.go"],
embed = [":go_default_library"],
deps = ["//vendor/github.com/spf13/cobra:go_default_library"],
)
Loading