Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kube-prometheus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
prometheus-operator
kube-prometheus
Commits
0f6cd6d0
Commit
0f6cd6d0
authored
4 years ago
by
Damien Grisonnet
Browse files
Options
Downloads
Patches
Plain Diff
Makefile: remove containerized tooling
Signed-off-by:
Damien Grisonnet
<
dgrisonn@redhat.com
>
parent
8fdf1c77
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+27
-40
27 additions, 40 deletions
Makefile
with
27 additions
and
40 deletions
Makefile
+
27
−
40
View file @
0f6cd6d0
SHELL
=
/bin/bash
-o
pipefail
JSONNET_ARGS
:=
-n
2
--max-blank-lines
2
--string-style
s
--comment-style
s
ifneq
(,$(shell which jsonnetfmt))
JSONNET_FMT_CMD
:=
jsonnetfmt
else
JSONNET_FMT_CMD
:=
jsonnet
JSONNET_FMT_ARGS
:=
fmt
$(
JSONNET_ARGS
)
endif
JSONNET_FMT
:=
$(
JSONNET_FMT_CMD
)
$(
JSONNET_FMT_ARGS
)
BIN_DIR
?=
$(
shell
pwd
)
/tmp/bin
FIRST_GOPATH
:=
$(
firstword
$(
subst :, ,
$(
shell go
env
GOPATH
)))
JB_BINARY
:=
$(
FIRST_GOPATH
)
/bin/jb
EMBEDMD_BINARY
:=
embedmd
CONTAINER_CMD
:=
docker run
--rm
\
-e
http_proxy
-e
https_proxy
-e
no_proxy
\
-u
=
"
$(
shell id -u
)
:
$(
shell id -g
)
"
\
-v
"
$(
shell go env GOCACHE
)
:/.cache/go-build"
\
-v
"
$(
PWD
)
:/go/src/github.com/coreos/kube-prometheus:Z"
\
-w
"/go/src/github.com/coreos/kube-prometheus"
\
quay.io/coreos/jsonnet-ci
EMBEDMD_BIN
=
$(
BIN_DIR
)
/embedmd
JB_BIN
=
$(
BIN_DIR
)
/jb
GOJSONTOYAML_BIN
=
$(
BIN_DIR
)
/gojsontoyaml
JSONNET_BIN
=
$(
BIN_DIR
)
/jsonnet
JSONNETFMT_BIN
=
$(
BIN_DIR
)
/jsonnetfmt
TOOLING
=
$(
EMBEDMD_BIN
)
$(
JB_BIN
)
$(
GOJSONTOYAML_BIN
)
$(
JSONNET_BIN
)
$(
JSONNETFMT_BIN
)
all
:
generate fmt test
JSONNETFMT_ARGS
=
-n
2
--max-blank-lines
2
--string-style
s
--comment-style
s
.PHONY
:
generate-in-docker
generate-in-docker
:
@
echo
">> Compiling assets and generating Kubernetes manifests"
$(
CONTAINER_CMD
)
make
$(
MFLAGS
)
generate
all
:
generate fmt test
.PHONY
:
clean
clean
:
# Remove all files and directories ignored by git.
git clean
-Xfd
.
.PHONY
:
generate
generate
:
manifests **.md
**.md
:
$(shell find examples) build.sh example.jsonnet
$(
EMBEDMD_BIN
ARY
)
-w
`
find
.
-name
"*.md"
|
grep
-v
vendor
`
**.md
:
$(EMBEDMD_BIN)
$(shell find examples) build.sh example.jsonnet
$(
EMBEDMD_BIN
)
-w
`
find
.
-name
"*.md"
|
grep
-v
vendor
`
manifests
:
examples/kustomize.jsonnet vendor build.sh
rm
-rf
manifests
manifests
:
examples/kustomize.jsonnet $(GOJSONTOYAML_BIN) vendor build.sh
./build.sh
$<
vendor
:
$(JB_BIN
ARY
) jsonnetfile.json jsonnetfile.lock.json
vendor
:
$(JB_BIN) jsonnetfile.json jsonnetfile.lock.json
rm
-rf
vendor
$(
JB_BIN
ARY
)
install
$(
JB_BIN
)
install
fmt
:
.PHONY
:
fmt
fmt
:
$(JSONNETFMT_BIN)
find
.
-name
'vendor'
-prune
-o
-name
'*.libsonnet'
-o
-name
'*.jsonnet'
-print
|
\
xargs
-n
1
--
$(
JSONNET
_
FMT
)
-i
xargs
-n
1
--
$(
JSONNETFMT
_BIN
)
$(
JSONNETFMT_ARGS
)
-i
test
:
$(JB_BINARY)
$(
JB_BINARY
)
install
.PHONY
:
test
test
:
$(JB_BIN)
$(
JB_BIN
)
install
./test.sh
.PHONY
:
test-e2e
test-e2e
:
go
test
-timeout
55m
-v
./tests/e2e
-count
=
1
test-in-docker
:
@
echo
">> Compiling assets and generating Kubernetes manifests"
$(
CONTAINER_CMD
)
make
$(
MFLAGS
)
test
.PHONY
:
generate generate-in-docker test test-in-docker fmt
$(BIN_DIR)
:
mkdir
-p
$(
BIN_DIR
)
$(JB_BINARY)
:
go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.3.1
$(TOOLING)
:
$(BIN_DIR)
@
echo
Installing tools from scripts/tools.go
@
cd
scripts
&&
cat
tools.go |
grep
_ |
awk
-F
'"'
'{print $$2}'
| xargs
-tI
% go build
-o
$(
BIN_DIR
)
%
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment