Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
cli/Makefile at main · tektoncd/cli · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
tektoncd
cli
Repository navigation
Code
Issues
65
(65)
Pull requests
13
(13)
Discussions
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
cli
/
Makefile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
159 lines (120 loc) · 5.2 KB
main
Breadcrumbs
cli
/
Makefile
Copy path
Top
File metadata and controls
Code
Blame
159 lines (120 loc) · 5.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
GO
= go
PKGS
=
$(
or
$(
PKG
)
,
$(
shell
env GO111MODULE=on
$(
GO
)
list ./... | grep -v 'github.com/tektoncd/cli/third_party/')
)
BIN
=
$(
CURDIR
)
/.bin
export
GO111MODULE
=on
export
GOTOOLCHAIN
=auto
V
= 0
Q
=
$(
if
$(
filter
1,$V)
,,@)
M
=
$(
shell
printf "\033[34;1m🐱\033[0m")
TIMEOUT_UNIT
= 5m
TIMEOUT_E2E
= 20m
#
Get golangci version from workflow to match CI; fallback to tools/go.mod
GOLANGCI_VERSION
=
$(
or
$(
shell
yq '.jobs.linting.steps[] | select(.name == "golangci-lint")
| .with.version' .github/workflows/ci.yaml 2>/dev/null)
,
$(
shell
grep 'golangci/golangci-lint/v2' tools/go.mod | awk '{print $$3}')
)
YAML_FILES
:=
$(
shell
find . -type f -regex ".
*
y[a]ml" -print)
ifneq
(
$(
NAMESPACE
)
,)
NAMESPACELDFLAG := -X github.com/tektoncd/cli/pkg/cmd/version.namespace=$(NAMESPACE)
endif
ifneq
(
$(
SKIP_CHECK_FLAG
)
,)
SKIPLDFLAG := -X github.com/tektoncd/cli/pkg/cmd/version.skipCheckFlag=$(SKIP_CHECK_FLAG)
endif
ifneq
(,
$(
wildcard
./VERSION)
)
VERSIONLDFLAG := -X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=`cat VERSION`
endif
ifneq
(
$(
RELEASE_VERSION
)
,)
VERSIONLDFLAG := -X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=$(RELEASE_VERSION)
endif
FLAGS
:=
$(
VERSIONLDFLAG
)
ifneq
(
$(
SKIPLDFLAG
)
,)
FLAGS := $(FLAGS) $(SKIPLDFLAG)
endif
ifneq
(
$(
NAMESPACELDFLAG
)
,)
FLAGS := $(FLAGS) $(NAMESPACELDFLAG)
endif
ifneq
(
$(
FLAGS
)
,)
LDFLAGS := -ldflags "$(FLAGS)"
endif
all
: bin/tkn test
FORCE
:
.PHONY
: vendor
vendor
:
@
$(
GO
)
mod vendor
.PHONY
: cross
cross
: amd64 386 arm arm64 s390x ppc64le
#
# build cross platform binaries
.PHONY
: amd64
amd64
:
GOOS=linux GOARCH=amd64 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-amd64 ./cmd/tkn
GOOS=windows GOARCH=amd64 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-windows-amd64 ./cmd/tkn
GOOS=darwin GOARCH=amd64 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-darwin-amd64 ./cmd/tkn
.PHONY
: 386
386
:
GOOS=linux GOARCH=386 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-386 ./cmd/tkn
GOOS=windows GOARCH=386 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-windows-386 ./cmd/tkn
.PHONY
: arm
arm
:
GOOS=linux GOARCH=arm go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-arm ./cmd/tkn
.PHONY
: arm64
arm64
:
GOOS=linux GOARCH=arm64 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-arm64 ./cmd/tkn
GOOS=darwin GOARCH=arm64 go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-darwin-arm64 ./cmd/tkn
.PHONY
: s390x
s390x
:
GOOS=linux GOARCH=s390x go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-s390x ./cmd/tkn
.PHONY
: ppc64le
ppc64le
:
GOOS=linux GOARCH=ppc64le go build -mod=vendor
$(
LDFLAGS
)
-o bin/tkn-linux-ppc64le ./cmd/tkn
bin/
%
: cmd/
%
FORCE
$(
Q
)
$(
GO
)
build -mod=vendor
$(
LDFLAGS
)
-v -o
$@
./
$<
check
: lint test
.PHONY
: test
test
: test-unit
#
# run all tests
.PHONY
: lint
lint
: lint-go goimports lint-yaml
#
# run all linters
GOLANGCILINT
=
$(
or
$(
GOLANGCILINT_BIN
)
,
$(
BIN
)
/golangci-lint)
$(
BIN
)
/golangci-lint
: ;
$(
info
$(
M
)
getting golangci-lint
$(
GOLANGCI_VERSION
)
)
@mkdir -p
$(
BIN
)
GOTOOLCHAIN=go
$$(
grep '^go ' go.mod | awk '{print $$2}'
)
GOBIN=
$(
BIN
)
$(
GO
)
install -mod=mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@
$(
GOLANGCI_VERSION
)
.PHONY
: lint-go
lint-go
: |
$(
GOLANGCILINT
)
;
$(
info
$(
M
)
running golangci-lint…)
@
#
# Run golangci-lint (PKG=./pkg/pods/... for single package)
$Q
$(
GOLANGCILINT
)
run --modules-download-mode=vendor --max-issues-per-linter=0 --max-same-issues=0 --timeout 10m
$(
PKG
)
GOIMPORTS
=
$(
BIN
)
/goimports
$(
GOIMPORTS
)
: ;
$(
info
$(
M
)
getting goimports )
GOBIN=
$(
BIN
)
$(
GO
)
install -mod=mod golang.org/x/tools/cmd/goimports@latest
.PHONY
: goimports
goimports
: |
$(
GOIMPORTS
)
;
$(
info
$(
M
)
running goimports…)
#
# Run goimports
$Q
$(
GOIMPORTS
)
-l -e -w pkg cmd
test
@rm -f
$(
GOIMPORTS
)
.PHONY
: lint-yaml
lint-yaml
: ${YAML_FILES} ;
$(
info
$(
M
)
running yamllint…)
#
# runs yamllint on all yaml files
@yamllint -c .yamllint
$(
YAML_FILES
)
#
# Tests
TEST_UNIT_TARGETS
:= test-unit-verbose test-unit-race test-unit-verbose-and-race
test-unit-verbose
: ARGS=-v
test-unit-race
: ARGS=-race
test-unit-verbose-and-race
: ARGS=-v -race
$(
TEST_UNIT_TARGETS
)
: test-unit
.PHONY
:
$(
TEST_UNIT_TARGETS
)
test-unit
test-unit
: ;
$(
info
$(
M
)
running unit tests…)
#
# Run unit tests (PKG=./pkg/pods/... for single package)
$(
GO
)
test
-timeout
$(
TIMEOUT_UNIT
)
$(
ARGS
)
$(
PKGS
)
.PHONY
: update-golden
update-golden
: ./vendor ;
$(
info
$(
M
)
Running unit tests to update golden files…)
#
# run unit tests (updating golden files)
@./hack/update-golden.sh
.PHONY
: test-e2e
test-e2e
: bin/tkn ;
$(
info
$(
M
)
Running e2e tests…)
#
# run e2e tests
@LOCAL_CI_RUN=true bash ./test/e2e-tests.sh
.PHONY
: docs
docs
: bin/docs ;
$(
info
$(
M
)
Generating docs…)
#
# update docs
@mkdir -p ./docs/cmd ./docs/man/man1
@./bin/docs --target=./docs/cmd
@./bin/docs --target=./docs/man/man1 --kind=man
@rm -f ./bin/docs
.PHONY
: generated
generated
: update-golden docs fmt
#
# generate all files that needs to be generated
.PHONY
: clean
clean
:
#
# clean build artifacts
rm -fR bin VERSION
.PHONY
: fmt
#
# formats the GO code(excludes vendors dir)
fmt
: ;
$(
info
$(
M
)
running gofmt…)
@
#
# Run gofmt on all source files
$Q
$(
GO
)
fmt
$(
PKGS
)
.PHONY
: help
help
:
#
# print this help
@awk
'
BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}
'
$(
MAKEFILE_LIST
)
You can’t perform that action at this time.